Skip to content

Commit a5af410

Browse files
committed
libclang: Disable LLVM pretty stack trace functionality, which inadvertently
sets up signal handlers it shouldn't when we are being used a shared library. llvm-svn: 116084
1 parent d57f9ec commit a5af410

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/tools/libclang/CIndex.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "clang/Lex/Preprocessor.h"
3333
#include "llvm/ADT/STLExtras.h"
3434
#include "llvm/Support/CrashRecoveryContext.h"
35+
#include "llvm/Support/PrettyStackTrace.h"
3536
#include "llvm/Support/MemoryBuffer.h"
3637
#include "llvm/Support/raw_ostream.h"
3738
#include "llvm/Support/Timer.h"
@@ -1919,6 +1920,10 @@ static bool EnabledMultithreading;
19191920
extern "C" {
19201921
CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
19211922
int displayDiagnostics) {
1923+
// Disable pretty stack trace functionality, which will otherwise be a very
1924+
// poor citizen of the world and set up all sorts of signal handlers.
1925+
llvm::DisablePrettyStackTrace = true;
1926+
19221927
// We use crash recovery to make some of our APIs more reliable, implicitly
19231928
// enable it.
19241929
llvm::CrashRecoveryContext::Enable();

0 commit comments

Comments
 (0)