From: Argyrios Kyrtzidis Date: Fri, 28 Oct 2011 22:54:33 +0000 (+0000) Subject: [libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTransl... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c4b47eff0848dfd80854d70cb84b23b185828d4;p=clang [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 --- 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)) {