From 2bbcf156acc157377e814fbb1828a9fe89367ea2 Mon Sep 17 00:00:00 2001 From: Russell Gallop Date: Mon, 16 Dec 2019 15:01:22 +0000 Subject: [PATCH] [Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF Following on from 8ddcd1dc26ba, which added the support. As pointed out on D71059 this does not build on some systems with LLVM_ENABLE_THREADS=OFF. Differential Revision: https://reviews.llvm.org/D71548 --- llvm/include/llvm/Support/TimeProfiler.h | 2 +- llvm/lib/Support/TimeProfiler.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h index f43893a..b204542 100644 --- 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 index 4709122..ec01c6f 100644 --- a/llvm/lib/Support/TimeProfiler.cpp +++ b/llvm/lib/Support/TimeProfiler.cpp @@ -33,8 +33,7 @@ std::vector> namespace llvm { -thread_local std::unique_ptr TimeTraceProfilerInstance = - nullptr; +LLVM_THREAD_LOCAL std::unique_ptr TimeTraceProfilerInstance; typedef duration DurationType; typedef time_point TimePointType; -- 2.7.4