[cfe-commits] r130646 - /cfe/trunk/lib/AST/StmtPrinter.cpp
Chandler Carruth
chandlerc at gmail.com
Sun May 1 00:23:23 PDT 2011
Author: chandlerc
Date: Sun May 1 02:23:23 2011
New Revision: 130646
URL: http://llvm.org/viewvc/llvm-project?rev=130646&view=rev
Log:
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.
Modified:
cfe/trunk/lib/AST/StmtPrinter.cpp
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=130646&r1=130645&r2=130646&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Sun May 1 02:23:23 2011
@@ -1345,7 +1345,7 @@
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 @@
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) {
More information about the cfe-commits
mailing list