Round up the non-virtual size to the next char instead of rounding down.
llvm-svn: 127390
This commit is contained in:
parent
4d6eafa138
commit
e73807538a
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue