aboutsummaryrefslogtreecommitdiff
path: root/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
commit2d4d629d8a0de5112c7ae9d05c03ddbf6dcd956a (patch)
tree96cd130305c37217e349f5a44be0c2a7225b2e55 /tools/c-index-test/c-index-test.c
parent89922f86f4e7da383af2a62ef04ad8b93b941220 (diff)
Implement source/line/column hooks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80585 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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 3126b319ef..1ef8e924bc 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/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));
+ }
}
/*