From: Bill Wendling Date: Wed, 19 Dec 2018 04:36:42 +0000 (+0000) Subject: Revert accidentally included code. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b80d338e3b88e070111fcccf78616904881e202;p=clang Revert accidentally included code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349603 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index b10b3d852c..d209266049 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -378,17 +378,17 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, << InputExpr->getSourceRange()); } else if (Info.requiresImmediateConstant() && !Info.allowsRegister()) { if (!InputExpr->isValueDependent()) { - llvm::SmallVector Diags; - llvm::APSInt Result = InputExpr->EvaluateKnownConstInt(Context, &Diags); - if (!Diags.empty()) + Expr::EvalResult EVResult; + if (!InputExpr->EvaluateAsInt(EVResult, Context)) return StmtError( Diag(InputExpr->getBeginLoc(), diag::err_asm_immediate_expected) << Info.getConstraintStr() << InputExpr->getSourceRange()); - if (!Info.isValidAsmImmediate(Result)) - return StmtError(Diag(InputExpr->getBeginLoc(), - diag::err_invalid_asm_value_for_constraint) - << Result.toString(10) << Info.getConstraintStr() - << InputExpr->getSourceRange()); + llvm::APSInt Result = EVResult.Val.getInt(); + if (!Info.isValidAsmImmediate(Result)) + return StmtError(Diag(InputExpr->getBeginLoc(), + diag::err_invalid_asm_value_for_constraint) + << Result.toString(10) << Info.getConstraintStr() + << InputExpr->getSourceRange()); } } else {