Round up the non-virtual size to the next char instead of rounding down.

llvm-svn: 127390
This commit is contained in:
Ken Dyck 2011-03-10 01:53:59 +00:00
parent 4d6eafa138
commit e73807538a
1 changed files with 3 additions and 2 deletions

View File

@ -1183,8 +1183,9 @@ void RecordLayoutBuilder::Layout(const CXXRecordDecl *RD) {
LayoutFields(RD);
// FIXME: Size isn't always an exact multiple of the char width. Round up?
NonVirtualSize = Context.toCharUnitsFromBits(getSizeInBits());
NonVirtualSize = Context.toCharUnitsFromBits(
llvm::RoundUpToAlignment(getSizeInBits(),
Context.Target.getCharAlign()));
NonVirtualAlignment = Alignment;
// Lay out the virtual bases and add the primary virtual base offsets.