summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-06 19:41:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-06 19:41:16 +0000
commit8b71bc7d6b05cb8383be9f193f9cb1051ea6d607 (patch)
treefee763f8b433c2c8923c5c767aa2c9400cb675a6 /clang/tools/c-index-test/c-index-test.c
parentcb95a8fd20c7f9c700710094cdd326b279a19d51 (diff)
downloadbcm5719-llvm-8b71bc7d6b05cb8383be9f193f9cb1051ea6d607.tar.gz
bcm5719-llvm-8b71bc7d6b05cb8383be9f193f9cb1051ea6d607.zip
[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. llvm-svn: 169539
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 42d7a14787a..7a36d093a5c 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -2497,7 +2497,12 @@ static void index_indexDeclaration(CXClientData client_data,
printCXIndexContainer(info->lexicalContainer);
printf(" | isRedecl: %d", info->isRedeclaration);
printf(" | isDef: %d", info->isDefinition);
- printf(" | isContainer: %d", info->isContainer);
+ if (info->flags & CXIdxDeclFlag_Skipped) {
+ assert(!info->isContainer);
+ printf(" | isContainer: skipped");
+ } else {
+ printf(" | isContainer: %d", info->isContainer);
+ }
printf(" | isImplicit: %d\n", info->isImplicit);
for (i = 0; i != info->numAttributes; ++i) {
@@ -2608,6 +2613,8 @@ static unsigned getIndexOptions(void) {
index_opts |= CXIndexOpt_SuppressRedundantRefs;
if (getenv("CINDEXTEST_INDEXLOCALSYMBOLS"))
index_opts |= CXIndexOpt_IndexFunctionLocalSymbols;
+ if (!getenv("CINDEXTEST_DISABLE_SKIPPARSEDBODIES"))
+ index_opts |= CXIndexOpt_SkipParsedBodiesInSession;
return index_opts;
}
OpenPOWER on IntegriCloud