[cfe-commits] r71261 - in /cfe/trunk: lib/CodeGen/CGCall.cpp test/CodeGen/x86_32-arguments.c

Daniel Dunbar daniel at zuster.org
Fri May 8 13:55:51 PDT 2009


Author: ddunbar
Date: Fri May  8 15:55:49 2009
New Revision: 71261

URL: http://llvm.org/viewvc/llvm-project?rev=71261&view=rev
Log:
Darwin x86_32: Improve bit-field handling for returning records.
 - This turns out to be a no-op now that most of the handling for
   everything else is in place.

Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/test/CodeGen/x86_32-arguments.c

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=71261&r1=71260&r2=71261&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Fri May  8 15:55:49 2009
@@ -342,10 +342,6 @@
          e = RT->getDecl()->field_end(Context); i != e; ++i) {
     const FieldDecl *FD = *i;
     
-    // FIXME: Reject bit-fields wholesale for now; this is incorrect.
-    if (FD->isBitField())
-      return false;
-
     // Empty structures are ignored.
     if (isEmptyRecord(Context, FD->getType()))
       continue;

Modified: cfe/trunk/test/CodeGen/x86_32-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_32-arguments.c?rev=71261&r1=71260&r2=71261&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/x86_32-arguments.c (original)
+++ cfe/trunk/test/CodeGen/x86_32-arguments.c Fri May  8 15:55:49 2009
@@ -47,12 +47,10 @@
 
 // This should be passed just as s8.
 
-// FIXME: This is wrong, but we want the coverage of the other
-// tests. This should be the same as @f8_1.
-// RUN: grep 'define void @f9_1(%.truct.s9\* noalias sret %agg.result)' %t &&
+// RUN: grep 'define i64 @f9_1()' %t &&
 
-// FIXME: This is wrong, but we want the coverage of the other
-// tests. This should be the same as @f8_2.
+// FIXME: llvm-gcc expands this, this may have some value for the
+// backend in terms of optimization but doesn't change the ABI.
 // RUN: grep 'define void @f9_2(%.truct.s9\* byval %a0)' %t &&
 struct s9 {
   int a : 17;
@@ -96,11 +94,11 @@
 // 128-bits).
 
 // RUN: grep 'i32 @f17()' %t &&
-// RUN: grep -F 'void @f18(%3* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f19(%4* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f20(%5* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f21(%6* noalias sret %agg.result)' %t &&
-// RUN: grep -F 'void @f22(%7* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f18(%2* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f19(%3* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t &&
+// RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t &&
 struct { T11 a; } f17(void) {}
 struct { T12 a; } f18(void) {}
 struct { T13 a; } f19(void) {}
@@ -129,4 +127,7 @@
 // RUN: grep 'define i16 @f29()' %t &&
 struct s29 { struct { } a[1]; char b; char c; } f29(void) {}
 
+// RUN: grep 'define i16 @f30()' %t &&
+struct s30 { char a; char b : 4; } f30(void) {}
+
 // RUN: true





More information about the cfe-commits mailing list