summaryrefslogtreecommitdiffstats
path: root/include/clang-c
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 /include/clang-c
parentbbca564eec4eb841848a40014f7ddc9e5807125e (diff)
[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 'include/clang-c')
-rw-r--r--include/clang-c/Index.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 8d7d8595bd..54f461b9a1 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -204,6 +204,61 @@ CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
*/
CINDEX_LINKAGE void clang_disposeIndex(CXIndex index);
+typedef enum {
+ /**
+ * \brief Used to indicate that no special CXIndex options are needed.
+ */
+ CXGlobalOpt_None = 0x0,
+
+ /**
+ * \brief Used to indicate that threads that libclang creates for indexing
+ * purposes should use background priority.
+ * Affects \see clang_indexSourceFile, \see clang_indexTranslationUnit,
+ * \see clang_parseTranslationUnit, \see clang_saveTranslationUnit.
+ */
+ CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1,
+
+ /**
+ * \brief Used to indicate that threads that libclang creates for editing
+ * purposes should use background priority.
+ * Affects \see clang_reparseTranslationUnit, \see clang_codeCompleteAt,
+ * \see clang_annotateTokens
+ */
+ CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2,
+
+ /**
+ * \brief Used to indicate that all threads that libclang creates should use
+ * background priority.
+ */
+ CXGlobalOpt_ThreadBackgroundPriorityForAll =
+ CXGlobalOpt_ThreadBackgroundPriorityForIndexing |
+ CXGlobalOpt_ThreadBackgroundPriorityForEditing
+
+} CXGlobalOptFlags;
+
+/**
+ * \brief Sets general options associated with a CXIndex.
+ *
+ * For example:
+ * \code
+ * CXIndex idx = ...;
+ * clang_CXIndex_setGlobalOptions(idx,
+ * clang_CXIndex_getGlobalOptions(idx) |
+ * CXGlobalOpt_ThreadBackgroundPriorityForIndexing);
+ * \endcode
+ *
+ * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags.
+ */
+CINDEX_LINKAGE void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options);
+
+/**
+ * \brief Gets the general options associated with a CXIndex.
+ *
+ * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that
+ * are associated with the given CXIndex object.
+ */
+CINDEX_LINKAGE unsigned clang_CXIndex_getGlobalOptions(CXIndex);
+
/**
* \defgroup CINDEX_FILES File manipulation routines
*