summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSinan Kaya <41809318+franksinankaya@users.noreply.github.com>2019-02-07 04:28:29 -0500
committerJan Vorlicek <janvorli@microsoft.com>2019-02-07 10:28:29 +0100
commit328f79f1d9c17dd1ac00901631cd90a41e788022 (patch)
treeba2a543c43c40d87c98945432d2cf026b575e5b5
parent8152fc3c8d42fd9e8b80872bef63a29baa64229e (diff)
downloadcoreclr-328f79f1d9c17dd1ac00901631cd90a41e788022.tar.gz
coreclr-328f79f1d9c17dd1ac00901631cd90a41e788022.tar.bz2
coreclr-328f79f1d9c17dd1ac00901631cd90a41e788022.zip
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.
-rw-r--r--src/debug/daccess/daccess.cpp4
-rw-r--r--src/dlls/mscordac/mscordac.cpp4
-rw-r--r--src/inc/corhlprpriv.h6
-rw-r--r--src/vm/corhost.cpp6
-rw-r--r--src/vm/threads.cpp6
-rw-r--r--src/vm/threads.inl6
6 files changed, 16 insertions, 16 deletions
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<TRUE /*bGrow*/, TRUE /*bThrow*/>(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()
{