From 2873810c6f81a288bcb53b0da9af4c21858a4f20 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Wed, 22 Jul 2015 21:11:17 +0000 Subject: Rename RunCallBacksToRun to llvm::sys::RunSignalHandlers And expose it in Signals.h, allowing clients to call it directly, possibly LLVMErrorHandler which currently calls RunInterruptHandlers but not RunSignalHandlers, thus for example not printing the stack backtrace on Unixish OSes. On Windows it does happen because RunInterruptHandlers ends up calling the callbacks as well via Cleanup(). This difference in behaviour and code structures in */Signals.inc should be patched in the future. llvm-svn: 242936 --- llvm/lib/Support/Signals.cpp | 2 +- llvm/lib/Support/Unix/Signals.inc | 2 +- llvm/lib/Support/Windows/Signals.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Support') diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp index 598ef50175a..2c3560c3be9 100644 --- a/llvm/lib/Support/Signals.cpp +++ b/llvm/lib/Support/Signals.cpp @@ -28,7 +28,7 @@ using namespace sys; static ManagedStatic>> CallBacksToRun; -void RunCallBacksToRun() { +void sys::RunSignalHandlers() { if (!CallBacksToRun.isConstructed()) return; for (auto &I : *CallBacksToRun) diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index caccf7b377c..2332db58bfc 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -201,7 +201,7 @@ static RETSIGTYPE SignalHandler(int Sig) { } // Otherwise if it is a fault (like SEGV) run any handler. - RunCallBacksToRun(); + llvm::sys::RunSignalHandlers(); #ifdef __s390__ // On S/390, certain signals are delivered with PSW Address pointing to diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc index c8bc646fd2c..824edb3c39b 100644 --- a/llvm/lib/Support/Windows/Signals.inc +++ b/llvm/lib/Support/Windows/Signals.inc @@ -457,7 +457,7 @@ static void Cleanup() { llvm::sys::fs::remove(FilesToRemove->back()); FilesToRemove->pop_back(); } - RunCallBacksToRun(); + llvm::sys::RunSignalHandlers(); LeaveCriticalSection(&CriticalSection); } -- cgit v1.2.3