aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-03-27 06:06:26 +0000
committerBill Wendling <isanbard@gmail.com>2013-03-27 06:06:26 +0000
commitd835d9496c55848981c1d9db383a0de1be160925 (patch)
treedfa48c1f16c1c6a6d82bd2f3b536a5c6ac97fd8d
parent08aba1bc5536a4deabb8d0196bf30b80c61a0568 (diff)
Pass the diagnostic in for better error messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178120 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaStmtAsm.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index fc693e6cd7..4ca8d69bf6 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -129,10 +129,9 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
diag::err_asm_invalid_lvalue_in_output)
<< OutputExpr->getSourceRange());
- if (RequireCompleteType(OutputExpr->getLocStart(), Exprs[i]->getType(), 0))
- return StmtError(Diag(OutputExpr->getLocStart(),
- diag::err_dereference_incomplete_type)
- << Exprs[i]->getType());
+ if (RequireCompleteType(OutputExpr->getLocStart(), Exprs[i]->getType(),
+ diag::err_dereference_incomplete_type))
+ return StmtError();
OutputConstraintInfos.push_back(Info);
}
@@ -189,10 +188,9 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
continue;
if (!Ty->isVoidType() || !Info.allowsMemory())
- if (RequireCompleteType(InputExpr->getLocStart(), Exprs[i]->getType(), 0))
- return StmtError(Diag(InputExpr->getLocStart(),
- diag::err_dereference_incomplete_type)
- << Exprs[i]->getType());
+ if (RequireCompleteType(InputExpr->getLocStart(), Exprs[i]->getType(),
+ diag::err_dereference_incomplete_type))
+ return StmtError();
unsigned Size = Context.getTypeSize(Ty);
if (!Context.getTargetInfo().validateInputSize(Literal->getString(),