diff options
Diffstat (limited to 'llvm/lib/Support/Signals.cpp')
-rw-r--r-- | llvm/lib/Support/Signals.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp index 03482f9512c..7adccb1f238 100644 --- a/llvm/lib/Support/Signals.cpp +++ b/llvm/lib/Support/Signals.cpp @@ -69,3 +69,9 @@ void llvm::RemoveFileOnSignal(const std::string &Filename) { std::for_each(IntSigs, IntSigsEnd, RegisterHandler); std::for_each(KillSigs, KillSigsEnd, RegisterHandler); } + +/// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or +/// SIGSEGV) is delivered to the process, print a stack trace and then exit. +void llvm::PrintStackTraceOnErrorSignal() { + std::for_each(KillSigs, KillSigsEnd, RegisterHandler); +} |