Revert r148056 while I investigate failures.

llvm-svn: 148068
This commit is contained in:
Eli Friedman 2012-01-12 23:27:03 +00:00
parent 9bcb72136e
commit 43f1834fad
2 changed files with 5 additions and 15 deletions

View File

@ -1867,13 +1867,14 @@ void RecordLayoutBuilder::LayoutField(const FieldDecl *D) {
Context.toBits(UnpackedFieldAlign), FieldPacked, D); Context.toBits(UnpackedFieldAlign), FieldPacked, D);
// Reserve space for this field. // Reserve space for this field.
uint64_t FieldSizeInBits = Context.toBits(FieldSize);
if (IsUnion) if (IsUnion)
setDataSize(std::max(getDataSize(), FieldSize)); setSize(std::max(getSizeInBits(), FieldSizeInBits));
else else
setDataSize(FieldOffset + FieldSize); setSize(FieldOffset + FieldSize);
// Update the size. // Update the data size.
setSize(std::max(getSize(), getDataSize())); setDataSize(getSizeInBits());
// Remember max struct/class alignment. // Remember max struct/class alignment.
UpdateAlignment(FieldAlign, UnpackedFieldAlign); UpdateAlignment(FieldAlign, UnpackedFieldAlign);

View File

@ -144,14 +144,3 @@ struct B : Empty, A { };
SA(0, sizeof(B) == 16); 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);
}