aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-17 01:42:24 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-17 01:42:24 +0000
commit2ef6f8f5a35a60870594c5b04e0aa2bf22c6886f (patch)
tree684b4ade05b4130a929cc6bd4e94cfae328482c1 /tools/c-index-test/c-index-test.c
parentab44216009dbdaa9a3b26f541ead13e85f6e39b3 (diff)
Convert clang_getCompletionChunkText() to return a CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96439 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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 360f75a66e..640375aaea 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -755,7 +755,8 @@ void print_completion_string(CXCompletionString completion_string, FILE *file) {
N = clang_getNumCompletionChunks(completion_string);
for (I = 0; I != N; ++I) {
- const char *text = 0;
+ CXString text;
+ const char *cstr;
enum CXCompletionChunkKind Kind
= clang_getCompletionChunkKind(completion_string, I);
@@ -769,10 +770,13 @@ void print_completion_string(CXCompletionString completion_string, FILE *file) {
}
text = clang_getCompletionChunkText(completion_string, I);
+ cstr = clang_getCString(text);
fprintf(file, "{%s %s}",
clang_getCompletionChunkKindSpelling(Kind),
- text? text : "");
+ cstr ? cstr : "");
+ clang_disposeString(text);
}
+
}
void print_completion_result(CXCompletionResult *completion_result,