Skip to content

Commit 8fd8a97

Browse files
committed
[llvm] Refactor leftover ThreadLocal usage in MinGW code
This code was accidently left over after https://reviews.llvm.org/D141349 and now leads to compilation failure due to missing declaration (since the class has been removed) Just migrate it by making use of `LLVM_THREAD_LOCAL` instead. Differential Revision: https://reviews.llvm.org/D141535
1 parent 7df7612 commit 8fd8a97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Support/CrashRecoveryContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,25 +307,25 @@ static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
307307
// CrashRecoveryContext at all. So we make use of a thread-local
308308
// exception table. The handles contained in here will either be
309309
// non-NULL, valid VEH handles, or NULL.
310-
static sys::ThreadLocal<const void> sCurrentExceptionHandle;
310+
static LLVM_THREAD_LOCAL const void* sCurrentExceptionHandle;
311311

312312
static void installExceptionOrSignalHandlers() {
313313
// We can set up vectored exception handling now. We will install our
314314
// handler as the front of the list, though there's no assurances that
315315
// it will remain at the front (another call could install itself before
316316
// our handler). This 1) isn't likely, and 2) shouldn't cause problems.
317317
PVOID handle = ::AddVectoredExceptionHandler(1, ExceptionHandler);
318-
sCurrentExceptionHandle.set(handle);
318+
sCurrentExceptionHandle = handle;
319319
}
320320

321321
static void uninstallExceptionOrSignalHandlers() {
322-
PVOID currentHandle = const_cast<PVOID>(sCurrentExceptionHandle.get());
322+
PVOID currentHandle = const_cast<PVOID>(sCurrentExceptionHandle);
323323
if (currentHandle) {
324324
// Now we can remove the vectored exception handler from the chain
325325
::RemoveVectoredExceptionHandler(currentHandle);
326326

327327
// Reset the handle in our thread-local set.
328-
sCurrentExceptionHandle.set(NULL);
328+
sCurrentExceptionHandle = NULL;
329329
}
330330
}
331331

0 commit comments

Comments
 (0)