[llvm-branch-commits] [cfe-branch] r71315 - 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:21:39 PDT 2009


Author: mrs
Date: Fri May  8 22:21:37 2009
New Revision: 71315

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

Darwin x86_32: Ignore arrays of empty structures inside records.
 - This eliminates 5/1000 failures on return-types-32, on the current
   ABITest config.

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=71315&r1=71314&r2=71315&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp Fri May  8 22:21:37 2009
@@ -350,6 +350,13 @@
     if (isEmptyRecord(Context, FD->getType()))
       continue;
 
+    // As are arrays of empty structures, but not generally, so we
+    // can't add this test higher in this routine.
+    if (const ConstantArrayType *AT = 
+        Context.getAsConstantArrayType(FD->getType()))
+      if (isEmptyRecord(Context, AT->getElementType()))
+        continue;
+
     // Check fields recursively.
     if (!shouldReturnTypeInRegister(FD->getType(), Context))
       return false;

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=71315&r1=71314&r2=71315&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:21:37 2009
@@ -120,10 +120,13 @@
 // Small structures are handled recursively
 // RUN: grep -F 'i32 @f26()' %t &&
 // RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t &&
-struct s26 { struct { char a, b; } a; struct { char a, b } b; } f26(void) {}
-struct s27 { struct { char a, b, c; } a; struct { char a } b; } f27(void) {}
+struct s26 { struct { char a, b; } a; struct { char a, b; } b; } f26(void) {}
+struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) {}
 
 // RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t &&
-struct s28 { int a; int b[] } f28(void) {}
+struct s28 { int a; int b[]; } f28(void) {}
+
+// RUN: grep 'define i16 @f29()' %t &&
+struct s29 { struct { } a[1]; char b; char c; } f29(void) {}
 
 // RUN: true





More information about the llvm-branch-commits mailing list