diff options
-rw-r--r-- | tools/libclang/CIndex.cpp | 6 |
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)) { |