aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-16 20:01:17 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-16 20:01:17 +0000
commit7d1d49d2971b20a97b3c2a301470b9eaaa130137 (patch)
treedb7d504f9c5b0c9157160ec521423d566c585c56 /tools/c-index-test/c-index-test.c
parent3cecc19f606ba1000da885b8ff4c089abad224dd (diff)
Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use this information to help CIndex filter out declarations that came from a precompiled header (rather than from an AST file). Further down the road, it can be used to help implement multi-level precompiled headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 716c15ddec..bfc8e620ac 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -86,10 +86,16 @@ int main(int argc, char **argv) {
}
{
CXIndex Idx = clang_createIndex();
+ if (!strcmp(argv[2], "local"))
+ clang_wantOnlyLocalDeclarations(Idx);
CXTranslationUnit TU = clang_createTranslationUnit(Idx, argv[1]);
+ if (!TU) {
+ fprintf(stderr, "Unable to load translation unit!\n");
+ return 1;
+ }
enum CXCursorKind K = CXCursor_NotImplemented;
- if (!strcmp(argv[2], "all")) {
+ if (!strcmp(argv[2], "all") || !strcmp(argv[2], "local")) {
clang_loadTranslationUnit(TU, TranslationUnitVisitor, 0);
clang_disposeTranslationUnit(TU);
return 1;