[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.

llvm-svn: 143242
This commit is contained in:
Argyrios Kyrtzidis 2011-10-28 22:54:33 +00:00
parent b12986f1cb
commit d92ced00b1
1 changed files with 6 additions and 0 deletions

View File

@ -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)) {