Fixing code gen to handle microsoft layouts for which size % alignment

!= 0

llvm-svn: 193661
This commit is contained in:
Warren Hunt
2013-10-29 23:49:26 +00:00
parent 251a1bd215
commit dbbc5dfd12

View File

@@ -203,6 +203,9 @@ public:
void CGRecordLayoutBuilder::Layout(const RecordDecl *D) {
Alignment = Types.getContext().getASTRecordLayout(D).getAlignment();
Packed = D->hasAttr<PackedAttr>();
const ASTRecordLayout &Layout = Types.getContext().getASTRecordLayout(D);
if (Layout.getSize() % Layout.getAlignment() != 0)
Packed = true;
if (D->isUnion()) {
LayoutUnion(D);