summaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-28 02:18:05 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-03-28 02:18:05 +0000
commitfdc1795acc9d5d73a767cc7d43ad1546e93adbba (patch)
tree67f7fb7e785961ad689e7dd78c415300c3bf2a33 /tools/libclang/CIndexCodeCompletion.cpp
parentbbca564eec4eb841848a40014f7ddc9e5807125e (diff)
downloadclang-fdc1795acc9d5d73a767cc7d43ad1546e93adbba.tar.gz
clang-fdc1795acc9d5d73a767cc7d43ad1546e93adbba.tar.bz2
clang-fdc1795acc9d5d73a767cc7d43ad1546e93adbba.tar.xz
[libclang] Introduce options to control the priority for the threads
that libclang creates. -Introduce CXGlobalOptFlags enum for the new options that can be set on the CXIndex object. -CXGlobalOpt_ThreadBackgroundPriorityForIndexing affects: clang_indexSourceFile clang_indexTranslationUnit clang_parseTranslationUnit clang_saveTranslationUnit -CXGlobalOpt_ThreadBackgroundPriorityForEditing affects: clang_reparseTranslationUnit clang_codeCompleteAt clang_annotateTokens rdar://9075282 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r--tools/libclang/CIndexCodeCompletion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index 1b4a7e4800..c5bc8c8dd4 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/tools/libclang/CIndexCodeCompletion.cpp
@@ -666,6 +666,10 @@ void clang_codeCompleteAt_Impl(void *UserData) {
if (!AST)
return;
+ CIndexer *CXXIdx = (CIndexer*)TU->CIdx;
+ if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForEditing))
+ setBackGroundPriority();
+
ASTUnit::ConcurrencyCheck Check(*AST);
// Perform the remapping of source files.