When LLVM is embedded in a larger application, it's not OK for LLVM to intercept crashes. LLVM already has

the ability to disable this functionality.  This patch exposes it via the C API.

llvm-svn: 193937
This commit is contained in:
Filip Pizlo 2013-11-03 00:29:47 +00:00
parent f1b0baeb21
commit 9f50ccd1a3
2 changed files with 11 additions and 0 deletions

View File

@ -433,6 +433,12 @@ void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
*/
void LLVMResetFatalErrorHandler(void);
/**
* Disable LLVM's built-in stack trace code. This must be called before any
* other LLVM APIs; otherwise the results are undefined.
*/
void LLVMDisablePrettyStackTrace(void);
/**
* @defgroup LLVMCCoreContext Contexts
*

View File

@ -20,6 +20,7 @@
#include "llvm/Support/ThreadLocal.h"
#include "llvm/Support/Watchdog.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm-c/Core.h"
#ifdef HAVE_CRASHREPORTERCLIENT_H
#include <CrashReporterClient.h>
@ -147,3 +148,7 @@ void PrettyStackTraceProgram::print(raw_ostream &OS) const {
OS << ArgV[i] << ' ';
OS << '\n';
}
void LLVMDisablePrettyStackTrace() {
DisablePrettyStackTrace = true;
}