]> granicus.if.org Git - clang/commitdiff
Revert accidentally included code.
authorBill Wendling <isanbard@gmail.com>
Wed, 19 Dec 2018 04:36:42 +0000 (04:36 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 19 Dec 2018 04:36:42 +0000 (04:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349603 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmtAsm.cpp

index b10b3d852c66763b6bc7f8d32f7fe35b86ed964f..d209266049e60c060a06a2eb250ea734a4128b24 100644 (file)
@@ -378,17 +378,17 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
                          << InputExpr->getSourceRange());
     } else if (Info.requiresImmediateConstant() && !Info.allowsRegister()) {
       if (!InputExpr->isValueDependent()) {
-        llvm::SmallVector<PartialDiagnosticAt, 1> 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 {