From 8c4b47eff0848dfd80854d70cb84b23b185828d4 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 28 Oct 2011 22:54:33 +0000 Subject: [PATCH] [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 --- tools/libclang/CIndex.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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)) { -- 2.50.1