[cfe-commits] r167761 - in /cfe/trunk: lib/Sema/SemaStmtAsm.cpp test/CodeGen/x86_32-inline-asm.c

Bill Wendling isanbard at gmail.com
Mon Nov 12 14:01:56 PST 2012


Author: void
Date: Mon Nov 12 16:01:56 2012
New Revision: 167761

URL: http://llvm.org/viewvc/llvm-project?rev=167761&view=rev
Log:
Don't test for incomplete types.

Modified:
    cfe/trunk/lib/Sema/SemaStmtAsm.cpp
    cfe/trunk/test/CodeGen/x86_32-inline-asm.c

Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=167761&r1=167760&r2=167761&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Mon Nov 12 16:01:56 2012
@@ -181,9 +181,6 @@
     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))

Modified: cfe/trunk/test/CodeGen/x86_32-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-inline-asm.c?rev=167761&r1=167760&r2=167761&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-inline-asm.c Mon Nov 12 16:01:56 2012
@@ -7,7 +7,9 @@
 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 @@
   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.
 }





More information about the cfe-commits mailing list