[libcxx-commits] [libcxxabi] acaa4c8 - [libc++abi] Use __has_feature check to enable usage of thread_local for exception storage (#97591)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 8 13:20:26 PDT 2024


Author: Louis Dionne
Date: 2024-07-08T16:20:21-04:00
New Revision: acaa4c8bfd12eac4fa5f2c03e9d394f7bd8f1bd6

URL: https://github.com/llvm/llvm-project/commit/acaa4c8bfd12eac4fa5f2c03e9d394f7bd8f1bd6
DIFF: https://github.com/llvm/llvm-project/commit/acaa4c8bfd12eac4fa5f2c03e9d394f7bd8f1bd6.diff

LOG: [libc++abi] Use __has_feature check to enable usage of thread_local for exception storage (#97591)

Previously, we'd use HAS_THREAD_LOCAL which was never defined. Hence,
we'd basically never use the code path where we use thread_local.

Fixes #78207

Added: 
    

Modified: 
    libcxxabi/src/cxa_exception_storage.cpp

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp
index 2479f550e09eff..c842da195accbd 100644
--- a/libcxxabi/src/cxa_exception_storage.cpp
+++ b/libcxxabi/src/cxa_exception_storage.cpp
@@ -24,7 +24,7 @@ extern "C" {
 } // extern "C"
 } // namespace __cxxabiv1
 
-#elif defined(HAS_THREAD_LOCAL)
+#elif __has_feature(cxx_thread_local)
 
 namespace __cxxabiv1 {
 namespace {


        


More information about the libcxx-commits mailing list