mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 04:46:27 +08:00
Fixing code gen to handle microsoft layouts for which size % alignment
!= 0 llvm-svn: 193661
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user