[PATCH] D141535: [llvm] Refactor leftover ThreadLocal usage in MinGW code

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 12:47:45 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8fd8a97c9444: [llvm] Refactor leftover ThreadLocal usage in MinGW code (authored by zero9178).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141535

Files:
  llvm/lib/Support/CrashRecoveryContext.cpp


Index: llvm/lib/Support/CrashRecoveryContext.cpp
===================================================================
--- llvm/lib/Support/CrashRecoveryContext.cpp
+++ llvm/lib/Support/CrashRecoveryContext.cpp
@@ -307,7 +307,7 @@
 // CrashRecoveryContext at all.  So we make use of a thread-local
 // exception table.  The handles contained in here will either be
 // non-NULL, valid VEH handles, or NULL.
-static sys::ThreadLocal<const void> sCurrentExceptionHandle;
+static LLVM_THREAD_LOCAL const void* sCurrentExceptionHandle;
 
 static void installExceptionOrSignalHandlers() {
   // We can set up vectored exception handling now.  We will install our
@@ -315,17 +315,17 @@
   // it will remain at the front (another call could install itself before
   // our handler).  This 1) isn't likely, and 2) shouldn't cause problems.
   PVOID handle = ::AddVectoredExceptionHandler(1, ExceptionHandler);
-  sCurrentExceptionHandle.set(handle);
+  sCurrentExceptionHandle = handle;
 }
 
 static void uninstallExceptionOrSignalHandlers() {
-  PVOID currentHandle = const_cast<PVOID>(sCurrentExceptionHandle.get());
+  PVOID currentHandle = const_cast<PVOID>(sCurrentExceptionHandle);
   if (currentHandle) {
     // Now we can remove the vectored exception handler from the chain
     ::RemoveVectoredExceptionHandler(currentHandle);
 
     // Reset the handle in our thread-local set.
-    sCurrentExceptionHandle.set(NULL);
+    sCurrentExceptionHandle = NULL;
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141535.488347.patch
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230111/a707417d/attachment.bin>


More information about the llvm-commits mailing list