From: Bill Wendling Date: Mon, 12 Nov 2012 22:01:56 +0000 (+0000) Subject: Don't test for incomplete types. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ece32e3359ca34fcdab07829f5e9fdbfd157f78;p=clang Don't test for incomplete types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167761 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp index e3b5dd851f..2578e0f41e 100644 --- a/lib/Sema/SemaStmtAsm.cpp +++ b/lib/Sema/SemaStmtAsm.cpp @@ -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)) diff --git a/test/CodeGen/x86_32-inline-asm.c b/test/CodeGen/x86_32-inline-asm.c index 7b342a6a26..a9038abc84 100644 --- a/test/CodeGen/x86_32-inline-asm.c +++ b/test/CodeGen/x86_32-inline-asm.c @@ -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. }