aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-28 22:54:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-28 22:54:33 +0000
commit8c4b47eff0848dfd80854d70cb84b23b185828d4 (patch)
treed7f3a4f13755c2315ead7ec624441f7fa19810b0
parent407ef9a9286a05bd286174471889295f6615c1b2 (diff)
[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143242 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/libclang/CIndex.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index a9fd9e57d1..8f0c225d63 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2718,6 +2718,12 @@ int clang_reparseTranslationUnit(CXTranslationUnit TU,
unsigned options) {
ReparseTranslationUnitInfo RTUI = { TU, num_unsaved_files, unsaved_files,
options, 0 };
+
+ if (getenv("CINDEXTEST_NOTHREADS")) {
+ clang_reparseTranslationUnit_Impl(&RTUI);
+ return RTUI.result;
+ }
+
llvm::CrashRecoveryContext CRC;
if (!RunSafely(CRC, clang_reparseTranslationUnit_Impl, &RTUI)) {