[Index] Fix GCC warning. This is silly, but no llvm_unreachable and no C99.

llvm-svn: 322672
This commit is contained in:
Sam McCall 2018-01-17 15:57:14 +00:00
parent 5668cd3e57
commit 6b79024e12
1 changed files with 3 additions and 1 deletions

View File

@ -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) {