]> granicus.if.org Git - clang/commitdiff
Darwin x86_32: Improve bit-field handling for returning records.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 8 May 2009 20:55:49 +0000 (20:55 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 8 May 2009 20:55:49 +0000 (20:55 +0000)
 - This turns out to be a no-op now that most of the handling for
   everything else is in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71261 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp
test/CodeGen/x86_32-arguments.c

index e9f2bba303b7266b1678a7aff57b0460e4b0a786..eba5ff5b5e755736b98a3c5b37309243ff14156d 100644 (file)
@@ -342,10 +342,6 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty,
          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;
index 14144c438ca84d447ef22f5fa544cf7d2c6455bc..b18d2d0acb6bb1a1c6c9132774e8ca0a00c2a70f 100644 (file)
@@ -47,12 +47,10 @@ void f8_2(struct s8 a0) {
 
 // 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 @@ T16 f16(void) {}
 // 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 @@ 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: grep 'define i16 @f30()' %t &&
+struct s30 { char a; char b : 4; } f30(void) {}
+
 // RUN: true