Don't test for incomplete types.
authorBill Wendling <isanbard@gmail.com>
Mon, 12 Nov 2012 22:01:56 +0000 (22:01 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 12 Nov 2012 22:01:56 +0000 (22:01 +0000)
llvm-svn: 167761

clang/lib/Sema/SemaStmtAsm.cpp
clang/test/CodeGen/x86_32-inline-asm.c

index e3b5dd8..2578e0f 100644 (file)
@@ -181,9 +181,6 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
     InputConstraintInfos.push_back(Info);
 
     const Type *Ty = Exprs[i]->getType().getTypePtr();
-    if (Ty->isDependentType() || Ty->isIncompleteType())
-      continue;
-
     unsigned Size = Context.getTypeSize(Ty);
     if (!Context.getTargetInfo().validateInputSize(Literal->getString(),
                                                    Size))
index 7b342a6..a9038ab 100644 (file)
@@ -7,7 +7,9 @@ typedef u_int32_t uint32_t;
 typedef unsigned long long u_int64_t;
 typedef u_int64_t uint64_t;
 
-int main () {
+struct S;
+
+int func(struct S *s) {
   // Error out if size is > 32-bits.
   uint32_t msr = 0x8b;
   uint64_t val = 0;
@@ -21,4 +23,7 @@ int main () {
   unsigned char data;
   unsigned int port;
   __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
+
+  // Don't error out for incomplete types.
+  __asm(""::"a"(*s));  // No error expected.
 }