diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-28 02:18:05 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-28 02:18:05 +0000 |
| commit | 7317a5cbfcf7c309ca3c5635ec9fac9b1f3a76f1 (patch) | |
| tree | e181054664ae06fc89dc952fb8cdee28956d1160 /clang/include/clang-c | |
| parent | c557bada5a2f61f70aaaecc7a38607934c1f5ee9 (diff) | |
| download | bcm5719-llvm-7317a5cbfcf7c309ca3c5635ec9fac9b1f3a76f1.tar.gz bcm5719-llvm-7317a5cbfcf7c309ca3c5635ec9fac9b1f3a76f1.zip | |
[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
llvm-svn: 153562
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 8d7d8595bd2..54f461b9a10 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/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 * |

