[cfe-commits] r66837 - in /cfe/trunk/lib: AST/Expr.cpp Sema/SemaExpr.cpp
Douglas Gregor
dgregor at apple.com
Thu Mar 12 15:51:37 PDT 2009
Author: dgregor
Date: Thu Mar 12 17:51:37 2009
New Revision: 66837
URL: http://llvm.org/viewvc/llvm-project?rev=66837&view=rev
Log:
Eliminate some unused default cases in switches on the binary operator kind
Modified:
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=66837&r1=66836&r2=66837&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu Mar 12 17:51:37 2009
@@ -190,7 +190,8 @@
/// corresponds to, e.g. "<<=".
const char *BinaryOperator::getOpcodeStr(Opcode Op) {
switch (Op) {
- default: assert(0 && "Unknown binary operator");
+ case PtrMemD: return ".*";
+ case PtrMemI: return "->*";
case Mul: return "*";
case Div: return "/";
case Rem: return "%";
@@ -222,6 +223,8 @@
case OrAssign: return "|=";
case Comma: return ",";
}
+
+ return "";
}
InitListExpr::InitListExpr(SourceLocation lbraceloc,
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=66837&r1=66836&r2=66837&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Mar 12 17:51:37 2009
@@ -3886,8 +3886,6 @@
BinaryOperator::Opcode Opc = (BinaryOperator::Opcode)Op;
switch (Opc) {
- default:
- assert(0 && "Unknown binary expr!");
case BinaryOperator::Assign:
ResultTy = CheckAssignmentOperands(lhs, rhs, OpLoc, QualType());
break;
More information about the cfe-commits
mailing list