From 982774cbebd0280078ee5321ed638a266e79a597 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 19 Feb 2004 20:03:14 +0000 Subject: [PATCH] Implement new function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11631 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Signals.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Support/Signals.cpp b/lib/Support/Signals.cpp index 03482f9512c..7adccb1f238 100644 --- a/lib/Support/Signals.cpp +++ b/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); +}