diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-04-07 20:43:23 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-04-07 20:43:23 +0000 |
commit | 6bea2f4f88ddc4437c4a072ca60118e7ad8ed834 (patch) | |
tree | e29d3564f9a5d904c6a9e7ff27e9a9c2940dfc40 /llvm/lib/Support/Unix/Signals.inc | |
parent | 78aa3452f690cfa11ff49f9338f9a035335cf513 (diff) | |
download | bcm5719-llvm-6bea2f4f88ddc4437c4a072ca60118e7ad8ed834.tar.gz bcm5719-llvm-6bea2f4f88ddc4437c4a072ca60118e7ad8ed834.zip |
Add boolean to PrintStackTraceOnErrorSignal to disable crash reporting.
The current crash reporting on Mac OS is only disabled via an environment variable.
This adds a boolean (default false) which can also disable crash reporting.
The only client right now is the unittests which don't ever want crash reporting, but do want to detect killed programs.
Reduces the time to run the APFloat unittests on my machine from
[----------] 47 tests from APFloatTest (51250 ms total)
to
[----------] 47 tests from APFloatTest (765 ms total)
Reviewed by Reid Kleckner and Justin Bogner
llvm-svn: 234353
Diffstat (limited to 'llvm/lib/Support/Unix/Signals.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index a9b48e0b059..057bcab1600 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -486,12 +486,12 @@ void llvm::sys::DisableSystemDialogsOnCrash() {} /// PrintStackTraceOnErrorSignal - When an error signal (such as SIGABRT or /// SIGSEGV) is delivered to the process, print a stack trace and then exit. -void llvm::sys::PrintStackTraceOnErrorSignal() { +void llvm::sys::PrintStackTraceOnErrorSignal(bool DisableCrashReporting) { AddSignalHandler(PrintStackTraceSignalHandler, nullptr); #if defined(__APPLE__) && defined(ENABLE_CRASH_OVERRIDES) // Environment variable to disable any kind of crash dialog. - if (getenv("LLVM_DISABLE_CRASH_REPORT")) { + if (DisableCrashReporting || getenv("LLVM_DISABLE_CRASH_REPORT")) { mach_port_t self = mach_task_self(); exception_mask_t mask = EXC_MASK_CRASH; |