summaryrefslogtreecommitdiffstats
path: root/clang/tools/CIndex/CIndex.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-18 20:22:25 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-18 20:22:25 +0000
commit81d53769b5f7029a2c8bb1ebb4dc3ea3c2cb59b6 (patch)
tree13b654e41f2828b1b5ee50c9ebfb9a3629399d18 /clang/tools/CIndex/CIndex.cpp
parent707cf72cb8ef3ed3a66e4667eeb27ec235fe2376 (diff)
downloadbcm5719-llvm-81d53769b5f7029a2c8bb1ebb4dc3ea3c2cb59b6.tar.gz
bcm5719-llvm-81d53769b5f7029a2c8bb1ebb4dc3ea3c2cb59b6.zip
Introduce debugging/testing hook clang_enableStackTraces() into
CIndex, so that c-index-test to use it to call lvm::sys::PrintStackTraceOnErrorSignal(). llvm-svn: 96607
Diffstat (limited to 'clang/tools/CIndex/CIndex.cpp')
-rw-r--r--clang/tools/CIndex/CIndex.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 128b3b6e992..6e07ece4c35 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -27,6 +27,7 @@
#include "clang/Lex/Preprocessor.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/System/Program.h"
+#include "llvm/System/Signals.h"
// Needed to define L_TMPNAM on some systems.
#include <cstdio>
@@ -1935,6 +1936,10 @@ void clang_getDefinitionSpellingAndExtent(CXCursor C,
*endColumn = SM.getSpellingColumnNumber(Body->getRBracLoc());
}
+void clang_enableStackTraces(void) {
+ llvm::sys::PrintStackTraceOnErrorSignal();
+}
+
} // end: extern "C"
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud