]> granicus.if.org Git - clang/commitdiff
[libclang] Check for the 'LIBCLANG_NOTHREADS' environment variable before creating
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 22 Dec 2012 04:48:07 +0000 (04:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 22 Dec 2012 04:48:07 +0000 (04:48 +0000)
a separate thread for code-completion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170978 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndexCodeCompletion.cpp

index 456c477851697be0af3412550fa815d9609cce63..c1ee6097c9c21d2f8f02f4c761b5d688f2f1c8c6 100644 (file)
@@ -825,6 +825,12 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
   CodeCompleteAtInfo CCAI = { TU, complete_filename, complete_line,
                               complete_column, unsaved_files, num_unsaved_files,
                               options, 0 };
+
+  if (getenv("LIBCLANG_NOTHREADS")) {
+    clang_codeCompleteAt_Impl(&CCAI);
+    return CCAI.result;
+  }
+
   llvm::CrashRecoveryContext CRC;
 
   if (!RunSafely(CRC, clang_codeCompleteAt_Impl, &CCAI)) {