From 16bef857d91ad9328874b85f59edd04155aa9579 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 16 Oct 2009 20:01:17 +0000 Subject: 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. llvm-svn: 84267 --- clang/tools/c-index-test/c-index-test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'clang/tools/c-index-test/c-index-test.c') diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c index 716c15ddecf..bfc8e620ac7 100644 --- a/clang/tools/c-index-test/c-index-test.c +++ b/clang/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; -- cgit v1.2.3