Instead of round up sizes to '8', round them up to the alignment of the char

type.

llvm-svn: 127391
This commit is contained in:
Ken Dyck 2011-03-10 02:00:35 +00:00
parent e73807538a
commit a1a2e8decb

View File

@ -1301,7 +1301,8 @@ void RecordLayoutBuilder::LayoutWideBitField(uint64_t FieldSize,
uint64_t NewSizeInBits = FieldOffset + FieldSize;
setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
Context.Target.getCharAlign()));
UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
}
@ -1378,7 +1379,8 @@ void RecordLayoutBuilder::LayoutBitField(const FieldDecl *D) {
} else {
uint64_t NewSizeInBits = FieldOffset + FieldSize;
setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
Context.Target.getCharAlign()));
UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
}