summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-08-31 14:26:51 +0000
committerSteve Naroff <snaroff@apple.com>2009-08-31 14:26:51 +0000
commit772c1a457474aa4dccf45df22d0517bcddc6e943 (patch)
tree4e34dff1d0daeaede1e610d4c578520a6dcaf035 /clang/tools/c-index-test/c-index-test.c
parent3c62f5095ab2e7996d34f7ee8995892895675a04 (diff)
downloadbcm5719-llvm-772c1a457474aa4dccf45df22d0517bcddc6e943.tar.gz
bcm5719-llvm-772c1a457474aa4dccf45df22d0517bcddc6e943.zip
Implement source/line/column hooks.
llvm-svn: 80585
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 3126b319efd..1ef8e924bc3 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -3,9 +3,13 @@
#include <stdio.h>
static void PrintDecls(CXTranslationUnit Unit, CXCursor Cursor) {
- if (clang_isDeclaration(Cursor.kind))
- printf("%s => %s\n", clang_getKindSpelling(Cursor.kind),
- clang_getDeclSpelling(Cursor.decl));
+ if (clang_isDeclaration(Cursor.kind)) {
+ printf("%s => %s", clang_getKindSpelling(Cursor.kind),
+ clang_getDeclSpelling(Cursor.decl));
+ printf(" (%s,%d:%d)\n", clang_getCursorSource(Cursor),
+ clang_getCursorLine(Cursor),
+ clang_getCursorColumn(Cursor));
+ }
}
/*
OpenPOWER on IntegriCloud