diff options
author | Fangrui Song <maskray@google.com> | 2018-11-30 23:41:18 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-11-30 23:41:18 +0000 |
commit | 407659ab0a1048027b3419b163c245036469ec35 (patch) | |
tree | 52e6ecfa03743811c8c88293f77a520618561b15 /clang/lib/Sema/SemaStmtAsm.cpp | |
parent | cada498038e320b175130210c7bf2386e3e50a91 (diff) | |
download | bcm5719-llvm-407659ab0a1048027b3419b163c245036469ec35.tar.gz bcm5719-llvm-407659ab0a1048027b3419b163c245036469ec35.zip |
Revert "Revert r347417 "Re-Reinstate 347294 with a fix for the failures.""
It seems the two failing tests can be simply fixed after r348037
Fix 3 cases in Analysis/builtin-functions.cpp
Delete the bad CodeGen/builtin-constant-p.c for now
llvm-svn: 348053
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index e6d9b34dee9..d209266049e 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -378,11 +378,12 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, << InputExpr->getSourceRange()); } else if (Info.requiresImmediateConstant() && !Info.allowsRegister()) { if (!InputExpr->isValueDependent()) { - llvm::APSInt Result; - if (!InputExpr->EvaluateAsInt(Result, Context)) + Expr::EvalResult EVResult; + if (!InputExpr->EvaluateAsInt(EVResult, Context)) return StmtError( Diag(InputExpr->getBeginLoc(), diag::err_asm_immediate_expected) << 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) |