diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-11-28 14:04:12 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-11-28 14:04:12 +0000 |
commit | 48ee4ad3251d3e9998811e4a7bf85bf522b0e0d6 (patch) | |
tree | 9edab9060fcf90ca80bad874af9694abf7742bf8 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 1208240ac9d5eb00f7d6fe26d134081d5283e52c (diff) | |
download | bcm5719-llvm-48ee4ad3251d3e9998811e4a7bf85bf522b0e0d6.tar.gz bcm5719-llvm-48ee4ad3251d3e9998811e4a7bf85bf522b0e0d6.zip |
Re-commit r347417 "Re-Reinstate 347294 with a fix for the failures."
This was reverted in r347656 due to me thinking it caused a miscompile of
Chromium. Turns out it was the Chromium code that was broken.
llvm-svn: 347756
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 7250bbc64d1..600640f78c1 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1513,10 +1513,11 @@ bool CodeGenFunction::ConstantFoldsToSimpleInteger(const Expr *Cond, bool AllowLabels) { // FIXME: Rename and handle conversion of other evaluatable things // to bool. - llvm::APSInt Int; - if (!Cond->EvaluateAsInt(Int, getContext())) + Expr::EvalResult Result; + if (!Cond->EvaluateAsInt(Result, 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. |