forked from OSchip/llvm-project
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…
Reference in New Issue