[llvm-branch-commits] [cfe-branch] r71316 - in /cfe/branches/Apple/Dib: lib/CodeGen/CGCall.cpp test/CodeGen/x86_32-arguments.c

Mike Stump mrs at apple.com
Fri May 8 20:22:39 PDT 2009


Author: mrs
Date: Fri May  8 22:22:39 2009
New Revision: 71316

URL: http://llvm.org/viewvc/llvm-project?rev=71316&view=rev
Log:
Merge in 71266:

Darwin x86_32: Ignore padding bit-fields when looking for "single
element" structures.

Modified:
    cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp
    cfe/branches/Apple/Dib/test/CodeGen/x86_32-arguments.c

Modified: cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp?rev=71316&r1=71315&r2=71316&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp Fri May  8 22:22:39 2009
@@ -204,11 +204,15 @@
       if (AT->getSize().getZExtValue() == 1)
         FT = AT->getElementType();
 
-    if (isEmptyRecord(Context, FT)) {
-      // Ignore
-    } else if (Found) {
+    // Ignore empty records and padding bit-fields.
+    if (isEmptyRecord(Context, FT) || 
+        (FD->isBitField() && !FD->getIdentifier()))
+      continue;
+
+    if (Found)
       return 0;
-    } else if (!CodeGenFunction::hasAggregateLLVMType(FT)) {
+
+    if (!CodeGenFunction::hasAggregateLLVMType(FT)) {
       Found = FT.getTypePtr();
     } else {
       Found = isSingleElementStruct(FT, Context);

Modified: cfe/branches/Apple/Dib/test/CodeGen/x86_32-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/CodeGen/x86_32-arguments.c?rev=71316&r1=71315&r2=71316&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/test/CodeGen/x86_32-arguments.c (original)
+++ cfe/branches/Apple/Dib/test/CodeGen/x86_32-arguments.c Fri May  8 22:22:39 2009
@@ -129,4 +129,7 @@
 // RUN: grep 'define i16 @f29()' %t &&
 struct s29 { struct { } a[1]; char b; char c; } f29(void) {}
 
+// RUN: grep 'define float @f31()' %t &&
+struct s31 { char : 0; float b; char : 0} f31(void) {}
+
 // RUN: true





More information about the llvm-branch-commits mailing list