summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/PrettyStackTrace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/PrettyStackTrace.cpp')
-rw-r--r--llvm/lib/Support/PrettyStackTrace.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp
index ed576d53600..bf7b150b842 100644
--- a/llvm/lib/Support/PrettyStackTrace.cpp
+++ b/llvm/lib/Support/PrettyStackTrace.cpp
@@ -16,6 +16,7 @@
#include "llvm-c/Core.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Config/config.h" // Get autoconf configuration settings
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Watchdog.h"
#include "llvm/Support/raw_ostream.h"
@@ -29,26 +30,7 @@ using namespace llvm;
// We need a thread local pointer to manage the stack of our stack trace
// objects, but we *really* cannot tolerate destructors running and do not want
// to pay any overhead of synchronizing. As a consequence, we use a raw
-// thread-local variable. Some day, we should be able to use a limited subset
-// of C++11's thread_local, but compilers aren't up for it today.
-// FIXME: This should be moved to a Compiler.h abstraction.
-#ifdef _MSC_VER
-// MSVC supports this with a __declspec.
-#define LLVM_THREAD_LOCAL __declspec(thread)
-#else
-// Clang, GCC, and all compatible compilers tend to use __thread. But we need
-// to work aronud a bug in the combination of Clang's compilation of
-// local-dynamic TLS and the ppc64 linker relocations which we do by forcing to
-// global-dynamic (called in most documents "general dynamic").
-// FIXME: Make this conditional on the Clang version once this is fixed in
-// top-of-tree.
-#if defined(__clang__) && defined(__powerpc64__)
-#define LLVM_THREAD_LOCAL __thread __attribute__((tls_model("global-dynamic")))
-#else
-#define LLVM_THREAD_LOCAL __thread
-#endif
-#endif
-
+// thread-local variable.
static LLVM_THREAD_LOCAL const PrettyStackTraceEntry *PrettyStackTraceHead =
nullptr;
OpenPOWER on IntegriCloud