From 9f0246d47390775ec3bf2c2b7e4ded3d26193468 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 21 Nov 2018 12:47:43 +0000 Subject: Revert r347364 again, the fix was incomplete. llvm-svn: 347389 --- clang/lib/CodeGen/CodeGenFunction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 600640f..7250bbc 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1513,11 +1513,10 @@ bool CodeGenFunction::ConstantFoldsToSimpleInteger(const Expr *Cond, bool AllowLabels) { // FIXME: Rename and handle conversion of other evaluatable things // to bool. - Expr::EvalResult Result; - if (!Cond->EvaluateAsInt(Result, getContext())) + llvm::APSInt Int; + if (!Cond->EvaluateAsInt(Int, getContext())) return false; // Not foldable, not integer or not fully evaluatable. - llvm::APSInt Int = Result.Val.getInt(); if (!AllowLabels && CodeGenFunction::ContainsLabel(Cond)) return false; // Contains a label. -- cgit v1.1