Remove a few more bogus returns when the switch covers all the

enumerators.

Also remove a default that led to llvm_unreachable to make another
switch warn if any enumerators fail to be covered.

llvm-svn: 130646
This commit is contained in:
Chandler Carruth 2011-05-01 07:23:23 +00:00
parent 8e2d6f4b31
commit e46eaf3460
1 changed files with 3 additions and 4 deletions

View File

@ -1345,7 +1345,7 @@ static const char *getTypeTraitName(BinaryTypeTrait BTT) {
case BTT_TypeCompatible: return "__builtin_types_compatible_p";
case BTT_IsConvertibleTo: return "__is_convertible_to";
}
return "";
llvm_unreachable("Binary type trait not covered by switch");
}
static const char *getTypeTraitName(ArrayTypeTrait ATT) {
@ -1353,16 +1353,15 @@ static const char *getTypeTraitName(ArrayTypeTrait ATT) {
case ATT_ArrayRank: return "__array_rank";
case ATT_ArrayExtent: return "__array_extent";
}
return "";
llvm_unreachable("Array type trait not covered by switch");
}
static const char *getExpressionTraitName(ExpressionTrait ET) {
switch (ET) {
default: llvm_unreachable("Unknown expression trait");
case ET_IsLValueExpr: return "__is_lvalue_expr";
case ET_IsRValueExpr: return "__is_rvalue_expr";
}
return "";
llvm_unreachable("Expression type trait not covered by switch");
}
void StmtPrinter::VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) {