Skip to content

Commit ba13ef0

Browse files
huoyaoyuanjkotas
andauthored
Delete unused System.Runtime.Versioning.CompatibilitySwitch (#99270)
* Use QCALL * Remove usage of Lazy * Apply suggestions from code review --------- Co-authored-by: Jan Kotas <[email protected]>
1 parent 4aa4ca5 commit ba13ef0

File tree

11 files changed

+31
-91
lines changed

11 files changed

+31
-91
lines changed

src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<EnableDefaultItems>false</EnableDefaultItems>
@@ -225,7 +225,6 @@
225225
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeLibrary.CoreCLR.cs" />
226226
<Compile Include="$(BclSourcesRoot)\System\Runtime\Intrinsics\X86\X86Base.CoreCLR.cs" />
227227
<Compile Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.CoreCLR.cs" />
228-
<Compile Include="$(BclSourcesRoot)\System\Runtime\Versioning\CompatibilitySwitch.cs" />
229228
<Compile Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" />
230229
<Compile Include="$(BclSourcesRoot)\System\RuntimeHandles.cs" />
231230
<Compile Include="$(BclSourcesRoot)\System\RuntimeType.ActivatorCache.cs" />

src/coreclr/System.Private.CoreLib/src/System/Runtime/Versioning/CompatibilitySwitch.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/coreclr/vm/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ set(VM_SOURCES_WKS
300300
comdependenthandle.cpp
301301
comdynamic.cpp
302302
commodule.cpp
303-
compatibilityswitch.cpp
304303
comsynchronizable.cpp
305304
comthreadpool.cpp
306305
comutilnative.cpp
@@ -402,7 +401,6 @@ set(VM_HEADERS_WKS
402401
comdependenthandle.h
403402
comdynamic.h
404403
commodule.h
405-
compatibilityswitch.h
406404
comsynchronizable.h
407405
comthreadpool.h
408406
comutilnative.h

src/coreclr/vm/compatibilityswitch.cpp

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/coreclr/vm/compatibilityswitch.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/coreclr/vm/corelib.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "floatdouble.h"
3030
#include "floatsingle.h"
3131
#include "comdatetime.h"
32-
#include "compatibilityswitch.h"
3332
#include "debugdebugger.h"
3433
#include "assemblynative.hpp"
3534
#include "comthreadpool.h"

src/coreclr/vm/ecalllist.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,6 @@ FCFuncStart(gCOMCustomAttributeFuncs)
251251
FCFuncElement("_GetPropertyOrFieldData", COMCustomAttribute::GetPropertyOrFieldData)
252252
FCFuncEnd()
253253

254-
FCFuncStart(gCompatibilitySwitchFuncs)
255-
FCFuncElement("GetValueInternal", CompatibilitySwitch::GetValue)
256-
FCFuncEnd()
257-
258254
FCFuncStart(gRuntimeAssemblyFuncs)
259255
FCFuncElement("FCallIsDynamic", AssemblyNative::IsDynamic)
260256
FCFuncElement("GetManifestModule", AssemblyHandle::GetManifestModule)
@@ -565,7 +561,6 @@ FCClassElement("AssemblyLoadContext", "System.Runtime.Loader", gAssemblyLoadCont
565561
FCClassElement("Buffer", "System", gBufferFuncs)
566562
FCClassElement("CastHelpers", "System.Runtime.CompilerServices", gCastHelpers)
567563
FCClassElement("ComAwareWeakReference", "System", gComAwareWeakReferenceFuncs)
568-
FCClassElement("CompatibilitySwitch", "System.Runtime.Versioning", gCompatibilitySwitchFuncs)
569564
FCClassElement("CustomAttribute", "System.Reflection", gCOMCustomAttributeFuncs)
570565
FCClassElement("Debugger", "System.Diagnostics", gDiagnosticsDebugger)
571566
FCClassElement("Delegate", "System", gDelegateFuncs)

src/coreclr/vm/nativeeventsource.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ extern "C" BOOL QCALLTYPE IsEventSourceLoggingEnabled()
3434
return retVal;
3535
}
3636

37+
extern "C" LPWSTR QCALLTYPE EventSource_GetClrConfig(LPCWSTR configName)
38+
{
39+
QCALL_CONTRACT;
40+
41+
LPWSTR ret = NULL;
42+
43+
BEGIN_QCALL;
44+
CLRConfig::ConfigStringInfo info;
45+
info.name = configName;
46+
info.options = CLRConfig::LookupOptions::Default;
47+
ret = CLRConfig::GetConfigValue(info);
48+
END_QCALL;
49+
50+
return ret;
51+
}
52+
3753
#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
3854

3955
#ifdef FEATURE_PERFTRACING

src/coreclr/vm/nativeeventsource.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414

1515
#include "qcall.h"
1616

17-
#if defined(FEATURE_PERFTRACING)
17+
#if defined(FEATURE_EVENTSOURCE_XPLAT)
1818
extern "C" void QCALLTYPE LogEventSource(_In_z_ int eventID, _In_z_ LPCWSTR eventName, _In_z_ LPCWSTR eventSourceName, _In_z_ LPCWSTR payload);
1919
extern "C" BOOL QCALLTYPE IsEventSourceLoggingEnabled();
20+
extern "C" LPWSTR QCALLTYPE EventSource_GetClrConfig(LPCWSTR configName);
21+
#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
22+
#if defined(FEATURE_PERFTRACING)
2023
extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);
2124
extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);
2225
extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);

src/coreclr/vm/qcallentrypoints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "floatdouble.h"
2525
#include "floatsingle.h"
2626
#include "comdatetime.h"
27-
#include "compatibilityswitch.h"
2827
#include "debugdebugger.h"
2928
#include "assemblynative.hpp"
3029
#include "comthreadpool.h"
@@ -352,6 +351,7 @@ static const Entry s_QCall[] =
352351
#if defined(FEATURE_EVENTSOURCE_XPLAT)
353352
DllImportEntry(IsEventSourceLoggingEnabled)
354353
DllImportEntry(LogEventSource)
354+
DllImportEntry(EventSource_GetClrConfig)
355355
#endif
356356
#if defined(FEATURE_PERFTRACING)
357357
DllImportEntry(LogThreadPoolWorkerThreadStart)

0 commit comments

Comments
 (0)