diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-14 00:11:49 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-14 00:11:49 +0000 |
commit | fb7d1455cd98b1a8046ae9ebc89dbb0895a7202c (patch) | |
tree | daee8ba285cd263650e4da55f61dbbe43c33c86d /clang/tools/c-index-test/c-index-test.c | |
parent | 87ea58f5cdff650fdb5be3f5d02a531fe4c9302b (diff) | |
download | llvm-fb7d1455cd98b1a8046ae9ebc89dbb0895a7202c.zip llvm-fb7d1455cd98b1a8046ae9ebc89dbb0895a7202c.tar.gz llvm-fb7d1455cd98b1a8046ae9ebc89dbb0895a7202c.tar.bz2 |
[libclang] Add CXIndexOpt_IndexFunctionLocalSymbols indexing option to indicate
that one wants indexing callbacks for function-local symbols as well.
llvm-svn: 148160
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r-- | clang/tools/c-index-test/c-index-test.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index d46f2dc..03eeb51 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/tools/c-index-test/c-index-test.c @@ -1911,6 +1911,17 @@ static IndexerCallbacks IndexCB = { index_indexEntityReference }; +static unsigned getIndexOptions(void) { + unsigned index_opts; + index_opts = 0; + if (getenv("CINDEXTEST_SUPPRESSREFS")) + index_opts |= CXIndexOpt_SuppressRedundantRefs; + if (getenv("CINDEXTEST_INDEXLOCALSYMBOLS")) + index_opts |= CXIndexOpt_IndexFunctionLocalSymbols; + + return index_opts; +} + static int index_file(int argc, const char **argv) { const char *check_prefix; CXIndex Idx; @@ -1946,10 +1957,7 @@ static int index_file(int argc, const char **argv) { index_data.fail_for_error = 0; index_data.abort = 0; - index_opts = 0; - if (getenv("CINDEXTEST_SUPPRESSREFS")) - index_opts |= CXIndexOpt_SuppressRedundantRefs; - + index_opts = getIndexOptions(); idxAction = clang_IndexAction_create(Idx); result = clang_indexSourceFile(idxAction, &index_data, &IndexCB,sizeof(IndexCB), index_opts, @@ -2001,10 +2009,7 @@ static int index_tu(int argc, const char **argv) { index_data.fail_for_error = 0; index_data.abort = 0; - index_opts = 0; - if (getenv("CINDEXTEST_SUPPRESSREFS")) - index_opts |= CXIndexOpt_SuppressRedundantRefs; - + index_opts = getIndexOptions(); idxAction = clang_IndexAction_create(Idx); result = clang_indexTranslationUnit(idxAction, &index_data, &IndexCB,sizeof(IndexCB), |