diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-08-04 01:21:14 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-08-04 01:21:14 +0000 |
commit | 61a62216a0bb33fb668ab653d9f9a704e43d2fc6 (patch) | |
tree | 999fee0c071a7f8b6d95330248ea3595c03e0be1 /lib/Basic/Targets.cpp | |
parent | a5e19c6b2554f6d9c4b9850d4dbbbfa3643282e5 (diff) |
Add partial support for using anonymous bitfields (e.g., int : 0) to enforce
alignment. This fixes cases where the anonymous bitfield is followed by a
non-bitfield member. E.g.,
struct t4
{
int foo : 1;
long : 0;
char bar;
};
Part of rdar://9859156
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index ec45a87fa0..89b6ce960b 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1963,6 +1963,16 @@ public: // structures. This corresponds to PCC_BITFIELD_TYPE_MATTERS in gcc. UseBitFieldTypeAlignment = false; + /// Do force alignment of members that follow zero length bitfields. If + /// the alignment of the zero-length bitfield is greater than the member + /// that follows it, `bar', `bar' will be aligned as the type of the + /// zero length bitfield. + UseZeroLengthBitfieldAlignment = true; + + /// gcc forces the alignment to 4 bytes, regardless of the type of the + /// zero length bitfield. + ZeroLengthBitfieldBoundary = 32; + if (IsThumb) { // Thumb1 add sp, #imm requires the immediate value be multiple of 4, // so set preferred for small types to 32. |