]> granicus.if.org Git - clang/commitdiff
libclang: Disable LLVM pretty stack trace functionality, which inadvertently
authorDaniel Dunbar <daniel@zuster.org>
Fri, 8 Oct 2010 19:30:33 +0000 (19:30 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 8 Oct 2010 19:30:33 +0000 (19:30 +0000)
sets up signal handlers it shouldn't when we are being used a shared library.

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

tools/libclang/CIndex.cpp

index 57367dd1596f71743bb83b429f3edf49e32e4928..1dfabcac65732619a767ecffb5c23a6f4f8757d2 100644 (file)
@@ -32,6 +32,7 @@
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/CrashRecoveryContext.h"
+#include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Timer.h"
@@ -1919,6 +1920,10 @@ static bool EnabledMultithreading;
 extern "C" {
 CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
                           int displayDiagnostics) {
+  // Disable pretty stack trace functionality, which will otherwise be a very
+  // poor citizen of the world and set up all sorts of signal handlers.
+  llvm::DisablePrettyStackTrace = true;
+
   // We use crash recovery to make some of our APIs more reliable, implicitly
   // enable it.
   llvm::CrashRecoveryContext::Enable();