Revert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS...
authorRussell Gallop <russell.gallop@sony.com>
Tue, 17 Dec 2019 08:59:05 +0000 (08:59 +0000)
committerRussell Gallop <russell.gallop@sony.com>
Tue, 17 Dec 2019 08:59:05 +0000 (08:59 +0000)
This reverts commit 2bbcf156acc157377e814fbb1828a9fe89367ea2.

This was failing on systems which use __thread such as
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/30851

llvm/include/llvm/Support/TimeProfiler.h
llvm/lib/Support/TimeProfiler.cpp

index b204542..f43893a 100644 (file)
@@ -14,7 +14,7 @@
 namespace llvm {
 
 struct TimeTraceProfiler;
-extern LLVM_THREAD_LOCAL std::unique_ptr<TimeTraceProfiler>
+extern thread_local std::unique_ptr<TimeTraceProfiler>
     TimeTraceProfilerInstance;
 
 /// Initialize the time trace profiler.
index ec01c6f..4709122 100644 (file)
@@ -33,7 +33,8 @@ std::vector<std::unique_ptr<llvm::TimeTraceProfiler>>
 
 namespace llvm {
 
-LLVM_THREAD_LOCAL std::unique_ptr<TimeTraceProfiler> TimeTraceProfilerInstance;
+thread_local std::unique_ptr<TimeTraceProfiler> TimeTraceProfilerInstance =
+    nullptr;
 
 typedef duration<steady_clock::rep, steady_clock::period> DurationType;
 typedef time_point<steady_clock> TimePointType;