mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 15:06:09 +00:00
Use "EvaluateAsRValue" instead of as a known int, because if it's not a known
integer we want to emit a diagnostic instead of asserting. llvm-svn: 349604
This commit is contained in:
parent
13381fbc29
commit
642e140beb
@ -379,7 +379,7 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
|
||||
} else if (Info.requiresImmediateConstant() && !Info.allowsRegister()) {
|
||||
if (!InputExpr->isValueDependent()) {
|
||||
Expr::EvalResult EVResult;
|
||||
if (!InputExpr->EvaluateAsInt(EVResult, Context))
|
||||
if (!InputExpr->EvaluateAsRValue(EVResult, Context, true))
|
||||
return StmtError(
|
||||
Diag(InputExpr->getBeginLoc(), diag::err_asm_immediate_expected)
|
||||
<< Info.getConstraintStr() << InputExpr->getSourceRange());
|
||||
|
Loading…
x
Reference in New Issue
Block a user