summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmtAsm.cpp
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
commitb68b7571a9164dfef521782d2ab0b277e1848e32 (patch)
tree2dba99371ad781f65e83402baba942ea4823b720 /clang/lib/Sema/SemaStmtAsm.cpp
parent3fa362a51a0593421080fa4178206b8bbff89eca (diff)
downloadbcm5719-llvm-b68b7571a9164dfef521782d2ab0b277e1848e32.tar.gz
bcm5719-llvm-b68b7571a9164dfef521782d2ab0b277e1848e32.zip
Pass the diagnostic in for better error messages.
llvm-svn: 178120
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index fc693e6cd78..4ca8d69bf6a 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/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(),
OpenPOWER on IntegriCloud