Revert r148056 while I investigate failures.
llvm-svn: 148068
This commit is contained in:
parent
9bcb72136e
commit
43f1834fad
|
@ -1867,13 +1867,14 @@ void RecordLayoutBuilder::LayoutField(const FieldDecl *D) {
|
|||
Context.toBits(UnpackedFieldAlign), FieldPacked, D);
|
||||
|
||||
// Reserve space for this field.
|
||||
uint64_t FieldSizeInBits = Context.toBits(FieldSize);
|
||||
if (IsUnion)
|
||||
setDataSize(std::max(getDataSize(), FieldSize));
|
||||
setSize(std::max(getSizeInBits(), FieldSizeInBits));
|
||||
else
|
||||
setDataSize(FieldOffset + FieldSize);
|
||||
setSize(FieldOffset + FieldSize);
|
||||
|
||||
// Update the size.
|
||||
setSize(std::max(getSize(), getDataSize()));
|
||||
// Update the data size.
|
||||
setDataSize(getSizeInBits());
|
||||
|
||||
// Remember max struct/class alignment.
|
||||
UpdateAlignment(FieldAlign, UnpackedFieldAlign);
|
||||
|
|
|
@ -144,14 +144,3 @@ struct B : Empty, A { };
|
|||
SA(0, sizeof(B) == 16);
|
||||
|
||||
}
|
||||
|
||||
namespace Test7 {
|
||||
// Make sure we reserve enough space for both bases; PR11745.
|
||||
struct Empty { };
|
||||
struct Base1 : Empty { };
|
||||
struct Base2 : Empty { };
|
||||
struct Test : Base1, Base2 {
|
||||
char c;
|
||||
};
|
||||
SA(0, sizeof(Test) == 2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue