summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-01-17 15:57:14 +0000
committerSam McCall <sam.mccall@gmail.com>2018-01-17 15:57:14 +0000
commit6b79024e129cbc8658595727809e18c49e5aba2d (patch)
tree432e48c76c90b73d55869a781d174ef3125180ef /clang/tools/c-index-test
parent5668cd3e571e91ae5887f62033c4c9b3d41981af (diff)
downloadbcm5719-llvm-6b79024e129cbc8658595727809e18c49e5aba2d.tar.gz
bcm5719-llvm-6b79024e129cbc8658595727809e18c49e5aba2d.zip
[Index] Fix GCC warning. This is silly, but no llvm_unreachable and no C99.
llvm-svn: 322672
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r--clang/tools/c-index-test/c-index-test.c4
1 files changed, 3 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 0b66eff0789..79b3a74b7c9 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -724,13 +724,13 @@ static int lineCol_cmp(const void *p1, const void *p2) {
}
static CXString CursorToText(CXCursor Cursor) {
+ CXString text;
switch (wanted_display_type) {
case DisplayType_Spelling:
return clang_getCursorSpelling(Cursor);
case DisplayType_DisplayName:
return clang_getCursorDisplayName(Cursor);
case DisplayType_Pretty: {
- CXString text;
CXPrintingPolicy Policy = clang_getCursorPrintingPolicy(Cursor);
ModifyPrintingPolicyAccordingToEnv(Policy);
text = clang_getCursorPrettyPrinted(Cursor, Policy);
@@ -738,6 +738,8 @@ static CXString CursorToText(CXCursor Cursor) {
return text;
}
}
+ assert(0 && "unknown display type"); // no llvm_unreachable in C.
+ return text; // garbage
}
static void PrintCursor(CXCursor Cursor, const char *CommentSchemaFile) {
OpenPOWER on IntegriCloud