summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-11-21 12:47:43 +0000
committerNico Weber <nicolasweber@gmx.de>2018-11-21 12:47:43 +0000
commit9f0246d47390775ec3bf2c2b7e4ded3d26193468 (patch)
treeb04d1324ec67a7b17d8824779c13deb94dac2812 /clang/lib/CodeGen/CodeGenFunction.cpp
parent4923930be5367488be818168916ad94dc878bb59 (diff)
downloadbcm5719-llvm-9f0246d47390775ec3bf2c2b7e4ded3d26193468.tar.gz
bcm5719-llvm-9f0246d47390775ec3bf2c2b7e4ded3d26193468.zip
Revert r347364 again, the fix was incomplete.
llvm-svn: 347389
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 600640f78c1..7250bbc64d1 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.
OpenPOWER on IntegriCloud