[llvm-branch-commits] [cfe-branch] r71318 - in /cfe/branches/Apple/Dib: lib/CodeGen/CGCall.cpp test/CodeGen/x86_64-arguments.c
Mike Stump
mrs at apple.com
Fri May 8 20:24:09 PDT 2009
Author: mrs
Date: Fri May 8 22:24:09 2009
New Revision: 71318
URL: http://llvm.org/viewvc/llvm-project?rev=71318&view=rev
Log:
Merge in 71272:
x86_64 ABI: Ignore padding bit-fields during classification.
- {return-types,single-args}-{32,64} pass the first 1k ABI tests with
bit-fields enabled.
Modified:
cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp
cfe/branches/Apple/Dib/test/CodeGen/x86_64-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=71318&r1=71317&r2=71318&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp Fri May 8 22:24:09 2009
@@ -205,8 +205,7 @@
FT = AT->getElementType();
// Ignore empty records and padding bit-fields.
- if (isEmptyRecord(Context, FT) ||
- (FD->isBitField() && !FD->getIdentifier()))
+ if (isEmptyRecord(Context, FT) || FD->isUnnamedBitfield())
continue;
if (Found)
@@ -807,6 +806,10 @@
// structure to be passed in memory even if unaligned, and
// therefore they can straddle an eightbyte.
if (BitField) {
+ // Ignore padding bit-fields.
+ if (i->isUnnamedBitfield())
+ continue;
+
uint64_t Offset = OffsetBase + Layout.getFieldOffset(idx);
uint64_t Size = i->getBitWidth()->EvaluateAsInt(Context).getZExtValue();
Modified: cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c?rev=71318&r1=71317&r2=71318&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c (original)
+++ cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c Fri May 8 22:24:09 2009
@@ -9,7 +9,7 @@
// RUN: grep 'define void @f7(i32 %a0)' %t &&
// RUN: grep 'type { i64, double }.*type .0' %t &&
// RUN: grep 'define .0 @f8_1()' %t &&
-// RUN: grep 'define void @f8_2(.0)' %t
+// RUN: grep 'define void @f8_2(.0)' %t &&
char f0(void) {
}
@@ -44,3 +44,12 @@
};
union u8 f8_1() {}
void f8_2(union u8 a0) {}
+
+// RUN: grep 'define i64 @f9()' %t &&
+struct s9 { int a; int b; int : 0; } f9(void) {}
+
+// RUN: grep 'define void @f10(i64)' %t &&
+struct s10 { int a; int b; int : 0; };
+void f10(struct s10 a0) {}
+
+// RUN: true
More information about the llvm-branch-commits
mailing list