[llvm] 531c711 - Revert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF"
Russell Gallop via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 01:01:05 PST 2019
Author: Russell Gallop
Date: 2019-12-17T08:59:05Z
New Revision: 531c71118f2910edcdc7b215dbb4ee429c623631
URL: https://github.com/llvm/llvm-project/commit/531c71118f2910edcdc7b215dbb4ee429c623631
DIFF: https://github.com/llvm/llvm-project/commit/531c71118f2910edcdc7b215dbb4ee429c623631.diff
LOG: Revert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF"
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
Added:
Modified:
llvm/include/llvm/Support/TimeProfiler.h
llvm/lib/Support/TimeProfiler.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index b20454242627..f43893a6d931 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -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.
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index ec01c6f2f7e3..47091221a788 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -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;
More information about the llvm-commits
mailing list