From 328f79f1d9c17dd1ac00901631cd90a41e788022 Mon Sep 17 00:00:00 2001 From: Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> Date: Thu, 7 Feb 2019 04:28:29 -0500 Subject: Cleanup LLVM assumption (#22456) We want to support GNU compilation for CoreCLR. Luckily both LLVM and GNU compilers define __GNUC__ and there are a lot of things they can share. --- src/debug/daccess/daccess.cpp | 4 ++-- src/dlls/mscordac/mscordac.cpp | 4 ++-- src/inc/corhlprpriv.h | 6 +++--- src/vm/corhost.cpp | 6 +++--- src/vm/threads.cpp | 6 +++--- src/vm/threads.inl | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp index 326e480a2e..95013760ca 100644 --- a/src/debug/daccess/daccess.cpp +++ b/src/debug/daccess/daccess.cpp @@ -7504,9 +7504,9 @@ STDAPI CLRDataAccessCreateInstance(ICLRDataTarget * pLegacyTarget, // This is the legacy entrypoint to DAC, used by dbgeng/dbghelp (windbg, SOS, watson, etc). // //---------------------------------------------------------------------------- -#ifdef __llvm__ +#ifdef __GNUC__ __attribute__((used)) -#endif // __llvm__ +#endif // __GNUC__ STDAPI CLRDataCreateInstance(REFIID iid, ICLRDataTarget * pLegacyTarget, diff --git a/src/dlls/mscordac/mscordac.cpp b/src/dlls/mscordac/mscordac.cpp index 94fdac5809..d126704a60 100644 --- a/src/dlls/mscordac/mscordac.cpp +++ b/src/dlls/mscordac/mscordac.cpp @@ -9,9 +9,9 @@ // // This dummy reference to CLRDataCreateInstance prevents the LLVM toolchain from optimizing this important export out. // -#ifdef __llvm__ +#ifdef __GNUC__ __attribute__((used)) -#endif // __llvm__ +#endif // __GNUC__ void DummyReferenceToExportedAPI() { diff --git a/src/inc/corhlprpriv.h b/src/inc/corhlprpriv.h index 73b89951dd..5eeec2098f 100644 --- a/src/inc/corhlprpriv.h +++ b/src/inc/corhlprpriv.h @@ -183,11 +183,11 @@ public: _Alloc(iItems); } -#ifdef __llvm__ +#ifdef __GNUC__ // This makes sure that we will not get an undefined symbol - // when building a release version of libcoreclr using LLVM. + // when building a release version of libcoreclr using LLVM/GCC. __attribute__((used)) -#endif // __llvm__ +#endif // __GNUC__ HRESULT ReSizeNoThrow(SIZE_T iItems); void Shrink(SIZE_T iItems) diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp index 4ac57d4a4b..82bf0e4dfe 100644 --- a/src/vm/corhost.cpp +++ b/src/vm/corhost.cpp @@ -51,11 +51,11 @@ GVAL_IMPL_INIT(DWORD, g_fHostConfig, 0); -#ifndef __llvm__ +#ifndef __GNUC__ EXTERN_C __declspec(thread) ThreadLocalInfo gCurrentThreadInfo; -#else // !__llvm__ +#else // !__GNUC__ EXTERN_C __thread ThreadLocalInfo gCurrentThreadInfo; -#endif // !__llvm__ +#endif // !__GNUC__ #ifndef FEATURE_PAL EXTERN_C UINT32 _tls_index; #else // FEATURE_PAL diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp index c8ebceb7f1..f657852d8b 100644 --- a/src/vm/threads.cpp +++ b/src/vm/threads.cpp @@ -299,11 +299,11 @@ bool Thread::DetectHandleILStubsForDebugger() } extern "C" { -#ifndef __llvm__ +#ifndef __GNUC__ __declspec(thread) -#else // !__llvm__ +#else // !__GNUC__ __thread -#endif // !__llvm__ +#endif // !__GNUC__ ThreadLocalInfo gCurrentThreadInfo = { NULL, // m_pThread diff --git a/src/vm/threads.inl b/src/vm/threads.inl index df50a51b02..53d94932e4 100644 --- a/src/vm/threads.inl +++ b/src/vm/threads.inl @@ -23,11 +23,11 @@ #ifndef DACCESS_COMPILE -#ifndef __llvm__ +#ifndef __GNUC__ EXTERN_C __declspec(thread) ThreadLocalInfo gCurrentThreadInfo; -#else // !__llvm__ +#else // !__GNUC__ EXTERN_C __thread ThreadLocalInfo gCurrentThreadInfo; -#endif // !__llvm__ +#endif // !__GNUC__ EXTERN_C inline Thread* STDCALL GetThread() { -- cgit v1.2.3