summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2018-11-21 20:44:18 +0000
committerBill Wendling <isanbard@gmail.com>2018-11-21 20:44:18 +0000
commit4e64d31bc5f3acbb9dd104dd4ae7ef492d4fe031 (patch)
treedd55b3cf11351ddce77e676435622743879ad499 /lib/CodeGen/CGStmt.cpp
parentcb1a557450468b15cb27dffafcaeba1a0a715e0d (diff)
downloadclang-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/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 10700bcf79..6e470ce113 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -1822,9 +1822,9 @@ llvm::Value* CodeGenFunction::EmitAsmInput(
// If this can't be a register or memory, i.e., has to be a constant
// (immediate or symbolic), try to emit it as such.
if (!Info.allowsRegister() && !Info.allowsMemory()) {
- llvm::APSInt Result;
+ Expr::EvalResult Result;
if (InputExpr->EvaluateAsInt(Result, getContext()))
- return llvm::ConstantInt::get(getLLVMContext(), Result);
+ return llvm::ConstantInt::get(getLLVMContext(), Result.Val.getInt());
assert(!Info.requiresImmediateConstant() &&
"Required-immediate inlineasm arg isn't constant?");
}