]> granicus.if.org Git - llvm/commitdiff
When LLVM is embedded in a larger application, it's not OK for LLVM to intercept...
authorFilip Pizlo <fpizlo@apple.com>
Sun, 3 Nov 2013 00:29:47 +0000 (00:29 +0000)
committerFilip Pizlo <fpizlo@apple.com>
Sun, 3 Nov 2013 00:29:47 +0000 (00:29 +0000)
the ability to disable this functionality.  This patch exposes it via the C API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193937 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Core.h
lib/Support/PrettyStackTrace.cpp

index 690ffa9fdc4df4a2c2c187e05d0fbe52062ba281..47d566c03e2ccdc3d68e5aecb5593ac9cfe46157 100644 (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
  *
index 315008ae810ed04d698ddb58d9cc4af81a805e1e..d08abc8ce155c2eb227184743b1d5ed52bd9350e 100644 (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;
+}