diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h --- a/llvm/include/llvm/Support/TimeProfiler.h +++ b/llvm/include/llvm/Support/TimeProfiler.h @@ -14,7 +14,7 @@ namespace llvm { struct TimeTraceProfiler; -extern thread_local std::unique_ptr +extern LLVM_THREAD_LOCAL std::unique_ptr TimeTraceProfilerInstance; /// Initialize the time trace profiler. diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp --- a/llvm/lib/Support/TimeProfiler.cpp +++ b/llvm/lib/Support/TimeProfiler.cpp @@ -33,8 +33,7 @@ namespace llvm { -thread_local std::unique_ptr TimeTraceProfilerInstance = - nullptr; +LLVM_THREAD_LOCAL std::unique_ptr TimeTraceProfilerInstance; typedef duration DurationType; typedef time_point TimePointType;