mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
Minor efficiency refactor related to 193661. No functional change.
llvm-svn: 193665
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user