Cleanup (dotnet/coreclr#27502)
authorJan Kotas <jkotas@microsoft.com>
Mon, 28 Oct 2019 18:00:04 +0000 (11:00 -0700)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2019 18:00:04 +0000 (11:00 -0700)
* Delete empty FireCustomerDebugProbe FCall

* Delete duplicate C++ compiler command line options

Commit migrated from https://github.com/dotnet/coreclr/commit/8460516ceb23458f7a279bb73aa6176e17e8a90d

src/coreclr/configurecompiler.cmake
src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs [deleted file]
src/coreclr/src/vm/ecalllist.h
src/coreclr/src/vm/object.h
src/coreclr/src/vm/safehandle.cpp
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.cs

index 187fbc0..3d5fd15 100644 (file)
@@ -454,7 +454,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
   add_compile_options(-fno-omit-frame-pointer)
 
   # The -fms-extensions enable the stuff like __if_exists, __declspec(uuid()), etc.
-  add_compile_options(-fms-extensions )
+  add_compile_options(-fms-extensions)
   #-fms-compatibility      Enable full Microsoft Visual C++ compatibility
   #-fms-extensions         Accept some non-standard constructs supported by the Microsoft compiler
 
@@ -511,9 +511,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
     # may not generate the same object layout as MSVC.
     add_compile_options(-Wno-incompatible-ms-struct)
   else()
-    add_compile_options(-Wno-unused-variable)
     add_compile_options(-Wno-unused-but-set-variable)
-    add_compile_options(-fms-extensions)
     add_compile_options(-Wno-unknown-pragmas)
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
       add_compile_options(-Wno-nonnull-compare)
index 0a1661d..c2a3aaa 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\GCSettings.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumerable.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Expando\IExpando.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandle.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.CoreCLR.cs" />
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs
deleted file mode 100644 (file)
index 451ae56..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace System.Runtime.InteropServices
-{
-    public abstract partial class CriticalHandle : CriticalFinalizerObject, IDisposable
-    {
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private extern void ReleaseHandleFailed();
-    }
-}
index b4f9a58..72201fa 100644 (file)
@@ -186,10 +186,6 @@ FCFuncStart(gExceptionFuncs)
     FCFuncElement("GetExceptionCount", ExceptionNative::GetExceptionCount)
 FCFuncEnd()
 
-FCFuncStart(gCriticalHandleFuncs)
-    FCFuncElement("ReleaseHandleFailed", CriticalHandle::FireCustomerDebugProbe)
-FCFuncEnd()
-
 FCFuncStart(gTypedReferenceFuncs)
     FCFuncElement("InternalToObject", ReflectionInvocation::TypedReferenceToObject)
     FCFuncElement("InternalMakeTypedReference", ReflectionInvocation::MakeTypedReference)
@@ -1217,7 +1213,6 @@ FCClassElement("AssemblyName", "System.Reflection", gAssemblyNameFuncs)
 FCClassElement("Buffer", "System", gBufferFuncs)
 FCClassElement("CLRConfig", "System", gClrConfig)
 FCClassElement("CompatibilitySwitch", "System.Runtime.Versioning", gCompatibilitySwitchFuncs)
-FCClassElement("CriticalHandle", "System.Runtime.InteropServices", gCriticalHandleFuncs)
 FCClassElement("CustomAttribute", "System.Reflection", gCOMCustomAttributeFuncs)
 FCClassElement("CustomAttributeEncodedArgument", "System.Reflection", gCustomAttributeEncodedArgument)
 FCClassElement("DateTime", "System", gDateTimeFuncs)
index 952630e..1a937d0 100644 (file)
@@ -2128,8 +2128,6 @@ class CriticalHandle : public Object
     static size_t GetHandleOffset() { LIMITED_METHOD_CONTRACT; return offsetof(CriticalHandle, m_handle); }
 
     void SetHandle(LPVOID handle) { LIMITED_METHOD_CONTRACT; m_handle = handle; }
-
-    static FCDECL1(void, FireCustomerDebugProbe, CriticalHandle* refThisUNSAFE);
 };
 
 
index 06fdf6c..632fa01 100644 (file)
@@ -219,17 +219,3 @@ void SafeHandle::RunReleaseMethod(SafeHandle* psh)
 
     GCPROTECT_END();
 }
-
-FCIMPL1(void, CriticalHandle::FireCustomerDebugProbe, CriticalHandle* refThisUNSAFE)
-{
-    FCALL_CONTRACT;
-
-    CRITICALHANDLEREF ch(refThisUNSAFE);
-
-    HELPER_METHOD_FRAME_BEGIN_1(ch);
-
-    FCUnique(0x53);
-
-    HELPER_METHOD_FRAME_END();
-}
-FCIMPLEND
index 83160dd..fc6a27d 100644 (file)
@@ -149,8 +149,7 @@ namespace System.Runtime.InteropServices
             // occur implicitly as part of unmarshaling another P/Invoke).
             int lastError = Marshal.GetLastWin32Error();
 
-            if (!ReleaseHandle())
-                ReleaseHandleFailed();
+            ReleaseHandle();
 
             Marshal.SetLastWin32Error(lastError);
             GC.SuppressFinalize(this);