From 8460516ceb23458f7a279bb73aa6176e17e8a90d Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 28 Oct 2019 11:00:04 -0700 Subject: [PATCH] Cleanup (#27502) * Delete empty FireCustomerDebugProbe FCall * Delete duplicate C++ compiler command line options --- configurecompiler.cmake | 4 +--- .../System.Private.CoreLib.csproj | 1 - .../Runtime/InteropServices/CriticalHandle.cs | 3 +-- .../InteropServices/CriticalHandle.CoreCLR.cs | 15 --------------- src/vm/ecalllist.h | 5 ----- src/vm/object.h | 2 -- src/vm/safehandle.cpp | 14 -------------- 7 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs diff --git a/configurecompiler.cmake b/configurecompiler.cmake index 187fbc0f7d52..3d5fd15741e2 100644 --- a/configurecompiler.cmake +++ b/configurecompiler.cmake @@ -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) diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 0a1661d2651f..c2a3aaa22184 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -257,7 +257,6 @@ - diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/CriticalHandle.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/CriticalHandle.cs index 83160dddea4e..fc6a27d18ca1 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/CriticalHandle.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/CriticalHandle.cs @@ -149,8 +149,7 @@ private void Cleanup() // occur implicitly as part of unmarshaling another P/Invoke). int lastError = Marshal.GetLastWin32Error(); - if (!ReleaseHandle()) - ReleaseHandleFailed(); + ReleaseHandle(); Marshal.SetLastWin32Error(lastError); GC.SuppressFinalize(this); diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs deleted file mode 100644 index 451ae563d984..000000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CriticalHandle.CoreCLR.cs +++ /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(); - } -} diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index b4f9a584faaf..72201faad01f 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -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) diff --git a/src/vm/object.h b/src/vm/object.h index 952630ebcff6..1a937d079725 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -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); }; diff --git a/src/vm/safehandle.cpp b/src/vm/safehandle.cpp index 06fdf6c0096a..632fa016e1ce 100644 --- a/src/vm/safehandle.cpp +++ b/src/vm/safehandle.cpp @@ -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