aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-10-20 14:46:24 +0000
committerSteve Naroff <snaroff@apple.com>2009-10-20 14:46:24 +0000
commite56b4baeba5097852e04bc41ca2e0396cf729955 (patch)
tree12f75dae17eaaa3bfbce00059e660186b94f41fc /tools/c-index-test/c-index-test.c
parent73c39abdbb79927605d740c93dd9629e3e4f9bfe (diff)
- 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
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, 3 insertions, 5 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 29cd1370e5..83d3d3f313 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -91,12 +91,10 @@ int main(int argc, char **argv) {
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");