diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-06 19:41:16 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-06 19:41:16 +0000 |
commit | 838eb7e8652e451d93494a4e583e4d11809bcb4a (patch) | |
tree | 332e35e9347d8749ea095f61cf08f697f158e38d /include/clang-c | |
parent | 14491490a5276ff4da9b28100fb8e7d442944288 (diff) |
[libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".
An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.
If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r-- | include/clang-c/Index.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index ac8f4dfa10..ea84de6d79 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 8 +#define CINDEX_VERSION_MINOR 9 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -5151,6 +5151,10 @@ typedef struct { CXIdxLoc classLoc; } CXIdxIBOutletCollectionAttrInfo; +typedef enum { + CXIdxDeclFlag_Skipped = 0x1 +} CXIdxDeclInfoFlags; + typedef struct { const CXIdxEntityInfo *entityInfo; CXCursor cursor; @@ -5172,6 +5176,9 @@ typedef struct { int isImplicit; const CXIdxAttrInfo *const *attributes; unsigned numAttributes; + + unsigned flags; + } CXIdxDeclInfo; typedef enum { @@ -5379,16 +5386,14 @@ CINDEX_LINKAGE void clang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity); /** - * \brief An indexing action, to be applied to one or multiple translation units - * but not on concurrent threads. If there are threads doing indexing - * concurrently, they should use different CXIndexAction objects. + * \brief An indexing action/session, to be applied to one or multiple + * translation units. */ typedef void *CXIndexAction; /** - * \brief An indexing action, to be applied to one or multiple translation units - * but not on concurrent threads. If there are threads doing indexing - * concurrently, they should use different CXIndexAction objects. + * \brief An indexing action/session, to be applied to one or multiple + * translation units. * * \param CIdx The index object with which the index action will be associated. */ @@ -5430,7 +5435,15 @@ typedef enum { /** * \brief Suppress all compiler warnings when parsing for indexing. */ - CXIndexOpt_SuppressWarnings = 0x8 + CXIndexOpt_SuppressWarnings = 0x8, + + /** + * \brief Skip a function/method body that was already parsed during an + * indexing session assosiated with a \c CXIndexAction object. + * Bodies in system headers are always skipped. + */ + CXIndexOpt_SkipParsedBodiesInSession = 0x10 + } CXIndexOptFlags; /** |