diff options
author | Reid Kleckner <rnk@google.com> | 2018-11-01 17:51:48 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-11-01 17:51:48 +0000 |
commit | e540d97b108bcc739544065c16ae62c236181b64 (patch) | |
tree | 8bea4da74a072ad99fc33e147aa1d07b940d55a1 | |
parent | 30d1b19b0b2b48511322739f473a59d256725bdd (diff) | |
download | bcm5719-llvm-e540d97b108bcc739544065c16ae62c236181b64.tar.gz bcm5719-llvm-e540d97b108bcc739544065c16ae62c236181b64.zip |
Replace two fallthrough annotations after covered switch with unreachable
Both preceding switches handle all possible enumerators, so the
fallthrough is actually unreachable. This strengthens that to an
assertion.
The first instance had a comment from 2010 indicating that fallthrough
was possible, but that was back when we had a unary operator for
offsetof. Now it is its own expression kind, so the annotation was
stale.
llvm-svn: 345862
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index bf08d6bb657..15efe433bd1 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -11143,9 +11143,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { case UO_Imag: return CheckICE(Exp->getSubExpr(), Ctx); } - - // OffsetOf falls through here. - LLVM_FALLTHROUGH; + llvm_unreachable("invalid unary operator class"); } case Expr::OffsetOfExprClass: { // Note that per C99, offsetof must be an ICE. And AFAIK, using @@ -11249,7 +11247,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { return Worst(LHSResult, RHSResult); } } - LLVM_FALLTHROUGH; + llvm_unreachable("invalid binary operator kind"); } case Expr::ImplicitCastExprClass: case Expr::CStyleCastExprClass: |