[PATCH] D87478: scudo: Remove the THREADLOCAL macro.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 19:16:53 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd876c7c8ec53: scudo: Remove the THREADLOCAL macro. (authored by pcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87478/new/

https://reviews.llvm.org/D87478

Files:
  compiler-rt/lib/scudo/standalone/internal_defs.h
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
  compiler-rt/lib/scudo/standalone/tsd_exclusive.h


Index: compiler-rt/lib/scudo/standalone/tsd_exclusive.h
===================================================================
--- compiler-rt/lib/scudo/standalone/tsd_exclusive.h
+++ compiler-rt/lib/scudo/standalone/tsd_exclusive.h
@@ -99,16 +99,16 @@
   atomic_u8 Disabled;
   TSD<Allocator> FallbackTSD;
   HybridMutex Mutex;
-  static THREADLOCAL ThreadState State;
-  static THREADLOCAL TSD<Allocator> ThreadTSD;
+  static thread_local ThreadState State;
+  static thread_local TSD<Allocator> ThreadTSD;
 
   friend void teardownThread<Allocator>(void *Ptr);
 };
 
 template <class Allocator>
-THREADLOCAL TSD<Allocator> TSDRegistryExT<Allocator>::ThreadTSD;
+thread_local TSD<Allocator> TSDRegistryExT<Allocator>::ThreadTSD;
 template <class Allocator>
-THREADLOCAL ThreadState TSDRegistryExT<Allocator>::State;
+thread_local ThreadState TSDRegistryExT<Allocator>::State;
 
 template <class Allocator> void teardownThread(void *Ptr) {
   typedef TSDRegistryExT<Allocator> TSDRegistryT;
Index: compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -152,7 +152,7 @@
 static bool Ready;
 
 template <typename Primary> static void performAllocations(Primary *Allocator) {
-  static THREADLOCAL typename Primary::CacheT Cache;
+  static thread_local typename Primary::CacheT Cache;
   Cache.init(nullptr, Allocator);
   std::vector<std::pair<scudo::uptr, void *>> V;
   {
Index: compiler-rt/lib/scudo/standalone/internal_defs.h
===================================================================
--- compiler-rt/lib/scudo/standalone/internal_defs.h
+++ compiler-rt/lib/scudo/standalone/internal_defs.h
@@ -36,7 +36,6 @@
 #define FORMAT(F, A) __attribute__((format(printf, F, A)))
 #define NOINLINE __attribute__((noinline))
 #define NORETURN __attribute__((noreturn))
-#define THREADLOCAL __thread
 #define LIKELY(X) __builtin_expect(!!(X), 1)
 #define UNLIKELY(X) __builtin_expect(!!(X), 0)
 #if defined(__i386__) || defined(__x86_64__)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87478.291116.patch
Type: text/x-patch
Size: 2129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200911/cc7ba7c0/attachment.bin>


More information about the llvm-commits mailing list