Minor efficiency refactor related to 193661. No functional change.

llvm-svn: 193665
This commit is contained in:
Warren Hunt
2013-10-30 00:14:55 +00:00
parent af41fcce0e
commit 7c55e7ef0e

View File

@@ -201,11 +201,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;
Alignment = Layout.getAlignment();
Packed = D->hasAttr<PackedAttr>() || Layout.getSize() % Alignment != 0;
if (D->isUnion()) {
LayoutUnion(D);