r178120 - Pass the diagnostic in for better error messages.

Bill Wendling isanbard at gmail.com
Tue Mar 26 23:06:27 PDT 2013


Author: void
Date: Wed Mar 27 01:06:26 2013
New Revision: 178120

URL: http://llvm.org/viewvc/llvm-project?rev=178120&view=rev
Log:
Pass the diagnostic in for better error messages.

Modified:
    cfe/trunk/lib/Sema/SemaStmtAsm.cpp

Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=178120&r1=178119&r2=178120&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Wed Mar 27 01:06:26 2013
@@ -129,10 +129,9 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceL
                             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(SourceL
       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(),





More information about the cfe-commits mailing list