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 | 4e64d31bc5f3acbb9dd104dd4ae7ef492d4fe031 (patch) | |
| tree | dd55b3cf11351ddce77e676435622743879ad499 /lib/CodeGen/CodeGenFunction.cpp | |
| parent | cb1a557450468b15cb27dffafcaeba1a0a715e0d (diff) | |
| download | clang-4e64d31bc5f3acbb9dd104dd4ae7ef492d4fe031.tar.gz | |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 7250bbc64d..600640f78c 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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. |
