summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-09-25 21:32:34 +0000
committerSteve Naroff <snaroff@apple.com>2009-09-25 21:32:34 +0000
commit63f475a212140302f9938b8bc1631186e800e5e9 (patch)
tree1d79313367a41b4ff2613bf43f7ee863ddf6967c /clang/tools/c-index-test/c-index-test.c
parent14a5cc54e58316fd514e6f6865575b65d8d088c3 (diff)
downloadbcm5719-llvm-63f475a212140302f9938b8bc1631186e800e5e9.tar.gz
bcm5719-llvm-63f475a212140302f9938b8bc1631186e800e5e9.zip
Add clang_getDeclLine and clang_getDeclColumn
Fix clang_getCursorDecl to do the right thing for expr refs Fixup test file to accommodate new output (which includes the line/column for the referenced decl) llvm-svn: 82798
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index f1f9372a187..aa93a7ed4f2 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -9,9 +9,16 @@ extern char *basename(const char *);
static void PrintCursor(CXCursor Cursor) {
if (clang_isInvalid(Cursor.kind))
printf("Invalid Cursor => %s\n", clang_getCursorKindSpelling(Cursor.kind));
- else
+ else {
printf("%s=%s", clang_getCursorKindSpelling(Cursor.kind),
clang_getCursorSpelling(Cursor));
+ if (Cursor.stmt) {
+ CXDecl DeclReferenced = clang_getCursorDecl(Cursor);
+ if (DeclReferenced)
+ printf(":%d:%d", clang_getDeclLine(DeclReferenced),
+ clang_getDeclColumn(DeclReferenced));
+ }
+ }
}
static void DeclVisitor(CXDecl Dcl, CXCursor Cursor, CXClientData Filter)
OpenPOWER on IntegriCloud