projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af41fcc
)
Minor efficiency refactor related to 193661. No functional change.
author
Warren Hunt
<whunt@google.com>
Wed, 30 Oct 2013 00:14:55 +0000
(
00:14
+0000)
committer
Warren Hunt
<whunt@google.com>
Wed, 30 Oct 2013 00:14:55 +0000
(
00:14
+0000)
llvm-svn: 193665
clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index
e67f517
..
a4e938f
100644
(file)
--- a/
clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/
clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@
-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);