diff options
| author | Bill Wendling <isanbard@gmail.com> | 2019-08-06 22:41:22 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2019-08-06 22:41:22 +0000 |
| commit | ce29291fc3bed3f1b6482a6f351d486600726886 (patch) | |
| tree | c28616f08bfeef79fb52a5cf4f17089aedf9bb52 /clang/lib/CodeGen | |
| parent | 0b168ffdc3fff3f88edaaa7de7444c119cbbdfc2 (diff) | |
| download | bcm5719-llvm-ce29291fc3bed3f1b6482a6f351d486600726886.tar.gz bcm5719-llvm-ce29291fc3bed3f1b6482a6f351d486600726886.zip | |
Delay diagnosing asm constraints that require immediates until after inlining
Summary:
An inline asm call may result in an immediate input value after inlining.
Therefore, don't emit a diagnostic here if the input isn't an immediate.
Reviewers: joerg, eli.friedman, rsmith
Subscribers: asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, s.egerton, krytarowski, mgorny, riccibruno, eraman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60943
llvm-svn: 368104
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index dd0dea5b94a..40ab79509f9 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -1846,11 +1846,9 @@ llvm::Value* CodeGenFunction::EmitAsmInput( InputExpr->EvaluateAsRValue(EVResult, getContext(), true); llvm::APSInt IntResult; - if (!EVResult.Val.toIntegralConstant(IntResult, InputExpr->getType(), - getContext())) - llvm_unreachable("Invalid immediate constant!"); - - return llvm::ConstantInt::get(getLLVMContext(), IntResult); + if (EVResult.Val.toIntegralConstant(IntResult, InputExpr->getType(), + getContext())) + return llvm::ConstantInt::get(getLLVMContext(), IntResult); } Expr::EvalResult Result; |

