From a79b8a22b4dcbd049837da4005e898c226e1ece4 Mon Sep 17 00:00:00 2001 From: Francis Ricci Date: Wed, 29 Mar 2017 21:49:47 +0000 Subject: [PATCH] Move current thread data out of lsan_common on linux Summary: Now that we have a platform-specific non-common lsan file, use it to store non-common lsan data. Reviewers: kubamracek Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31472 llvm-svn: 299032 --- compiler-rt/lib/lsan/lsan_common_linux.cc | 4 ---- compiler-rt/lib/lsan/lsan_linux.cc | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/lsan/lsan_common_linux.cc b/compiler-rt/lib/lsan/lsan_common_linux.cc index 0e10d41..931b511 100644 --- a/compiler-rt/lib/lsan/lsan_common_linux.cc +++ b/compiler-rt/lib/lsan/lsan_common_linux.cc @@ -34,10 +34,6 @@ static bool IsLinker(const char* full_name) { return LibraryNameIs(full_name, kLinkerName); } -static THREADLOCAL u32 current_thread_tid = kInvalidTid; -u32 GetCurrentThread() { return current_thread_tid; } -void SetCurrentThread(u32 tid) { current_thread_tid = tid; } - __attribute__((tls_model("initial-exec"))) THREADLOCAL int disable_counter; bool DisabledInThisThread() { return disable_counter > 0; } diff --git a/compiler-rt/lib/lsan/lsan_linux.cc b/compiler-rt/lib/lsan/lsan_linux.cc index c0b6f4b..a60f741 100644 --- a/compiler-rt/lib/lsan/lsan_linux.cc +++ b/compiler-rt/lib/lsan/lsan_linux.cc @@ -19,6 +19,10 @@ namespace __lsan { +static THREADLOCAL u32 current_thread_tid = kInvalidTid; +u32 GetCurrentThread() { return current_thread_tid; } +void SetCurrentThread(u32 tid) { current_thread_tid = tid; } + static THREADLOCAL AllocatorCache allocator_cache; AllocatorCache *GetAllocatorCache() { return &allocator_cache; } -- 2.7.4