[compiler-rt] r299032 - Move current thread data out of lsan_common on linux

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 14:49:48 PDT 2017


Author: fjricci
Date: Wed Mar 29 16:49:47 2017
New Revision: 299032

URL: http://llvm.org/viewvc/llvm-project?rev=299032&view=rev
Log:
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

Modified:
    compiler-rt/trunk/lib/lsan/lsan_common_linux.cc
    compiler-rt/trunk/lib/lsan/lsan_linux.cc

Modified: compiler-rt/trunk/lib/lsan/lsan_common_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common_linux.cc?rev=299032&r1=299031&r2=299032&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_linux.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common_linux.cc Wed Mar 29 16:49:47 2017
@@ -34,10 +34,6 @@ static bool IsLinker(const char* full_na
   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; }

Modified: compiler-rt/trunk/lib/lsan/lsan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_linux.cc?rev=299032&r1=299031&r2=299032&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_linux.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_linux.cc Wed Mar 29 16:49:47 2017
@@ -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; }
 




More information about the llvm-commits mailing list