]> granicus.if.org Git - clang/commitdiff
Remove else-after-return
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 3 May 2019 18:11:31 +0000 (18:11 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 3 May 2019 18:11:31 +0000 (18:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359913 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index 8386ce8f2d4357ed7bd9e5026d684cfc7bbb9553..6b3f4dcefa68ddfbdb591e8840fb1a734b84074b 100644 (file)
@@ -8269,17 +8269,16 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
 
   case Builtin::BI__builtin_constant_p: {
     const Expr *Arg = E->getArg(0);
-    if (EvaluateBuiltinConstantP(Info, Arg)) {
+    if (EvaluateBuiltinConstantP(Info, Arg))
       return Success(true, E);
-    } else if (Info.InConstantContext || Arg->HasSideEffects(Info.Ctx)) {
+    if (Info.InConstantContext || Arg->HasSideEffects(Info.Ctx)) {
       // Outside a constant context, eagerly evaluate to false in the presence
       // of side-effects in order to avoid -Wunsequenced false-positives in
       // a branch on __builtin_constant_p(expr).
       return Success(false, E);
-    } else {
-      Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);
-      return false;
     }
+    Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);
+    return false;
   }
 
   case Builtin::BI__builtin_is_constant_evaluated: