diff options
author | Bill Wendling <isanbard@gmail.com> | 2018-11-21 20:44:18 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2018-11-21 20:44:18 +0000 |
commit | 6ff1751f7d330191a2035144cabf7fa3cb232928 (patch) | |
tree | caa6155185901ee503e07efa16d122487df768b6 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 74fb1631840abda6de42929c4cdac0528f4cba3f (diff) | |
download | bcm5719-llvm-6ff1751f7d330191a2035144cabf7fa3cb232928.tar.gz bcm5719-llvm-6ff1751f7d330191a2035144cabf7fa3cb232928.zip |
Re-Reinstate 347294 with a fix for the failures.
Don't try to emit a scalar expression for a non-scalar argument to
__builtin_constant_p().
Third time's a charm!
llvm-svn: 347417
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. |