aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-26 18:31:56 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-26 18:31:56 +0000
commit0045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0 (patch)
treef5873f580c06b9beae1bcb82fcfa7e02a546b80e /tools/c-index-test/c-index-test.c
parent8f0954309eb885891908ecdfbb06d720c63128ed (diff)
Implement clang_annotateTokens(), which associates cursors with each
of the tokens within a raw token stream. This does not even attempt to handle macros yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94561 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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 1015aa5e74..243b8736f4 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -810,8 +810,13 @@ int perform_token_annotation(int argc, const char **argv) {
0, &start_line, &start_column);
clang_getInstantiationLocation(clang_getRangeEnd(extent),
0, &end_line, &end_column);
- printf("%s: \"%s\" [%d:%d - %d:%d]\n", kind, clang_getCString(spelling),
+ printf("%s: \"%s\" [%d:%d - %d:%d]", kind, clang_getCString(spelling),
start_line, start_column, end_line, end_column);
+ if (!clang_isInvalid(cursors[i].kind)) {
+ printf(" ");
+ PrintCursor(cursors[i]);
+ }
+ printf("\n");
}
free(cursors);