- Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.
- Remove clang_wantOnlyLocalDeclarations().
- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().
- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84634 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 29cd137..83d3d3f 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -91,12 +91,10 @@
CXTranslationUnit TU;
enum CXCursorKind K = CXCursor_NotImplemented;
- Idx = clang_createIndex();
+ Idx = clang_createIndex(/* excludeDeclsFromPCH */ !strcmp(argv[2], "local") ? 1 : 0,
+ /* displayDiagnostics */ 1);
- if (!strcmp(argv[2], "local"))
- clang_wantOnlyLocalDeclarations(Idx);
-
- TU = clang_createTranslationUnit(Idx, argv[1], /* displayDiagnostics= */ 1);
+ TU = clang_createTranslationUnit(Idx, argv[1]);
if (!TU) {
fprintf(stderr, "Unable to load translation unit!\n");