aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-04 20:04:59 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-04 20:04:59 +0000
commit3f35bb2d15a4df45a4e7d171b42c33c65b9267a3 (patch)
treedc86f5407735dc3be7429f82d2fab4ab5fe3e708 /clang/tools/c-index-test/c-index-test.c
parentc0174048a4506b437727357c373febb52666940a (diff)
downloadllvm-3f35bb2d15a4df45a4e7d171b42c33c65b9267a3.zip
llvm-3f35bb2d15a4df45a4e7d171b42c33c65b9267a3.tar.gz
llvm-3f35bb2d15a4df45a4e7d171b42c33c65b9267a3.tar.bz2
Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>. llvm-svn: 136911
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
-rw-r--r--clang/tools/c-index-test/c-index-test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index b737a38..0fec798 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -1333,7 +1333,13 @@ int inspect_cursor_at(int argc, const char **argv) {
clang_getLocation(TU, file, Locations[Loc].line,
Locations[Loc].column));
if (I + 1 == Repeats) {
+ CXCompletionString completionString = clang_getCursorCompletionString(
+ Cursor);
PrintCursor(TU, Cursor);
+ if (completionString != NULL) {
+ printf("\nCompletion string: ");
+ print_completion_string(completionString, stdout);
+ }
printf("\n");
free(Locations[Loc].filename);
}