[cfe-commits] r127390 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Ken Dyck
kd at kendyck.com
Wed Mar 9 17:54:00 PST 2011
Author: kjdyck
Date: Wed Mar 9 19:53:59 2011
New Revision: 127390
URL: http://llvm.org/viewvc/llvm-project?rev=127390&view=rev
Log:
Round up the non-virtual size to the next char instead of rounding down.
Modified:
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=127390&r1=127389&r2=127390&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Wed Mar 9 19:53:59 2011
@@ -1183,8 +1183,9 @@
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.
More information about the cfe-commits
mailing list