diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-02-27 04:11:37 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-02-27 04:11:37 +0000 |
commit | 0de40af3a3aa14e3854c0eafeabd08f6762801f9 (patch) | |
tree | c39a5b40f854cc6e7992e57cd1c2062b193c6243 /lib/CodeGen | |
parent | 60ce9635b969d17ff1bbe269deff5ec3c6b1bc06 (diff) |
Minor cleanup: use getDeclAlignInBytes helper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 75a8302792..6ebe12706b 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -713,17 +713,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { GV->setInitializer(Init); GV->setConstant(D->getType().isConstant(Context)); - - // FIXME: This is silly; getTypeAlign should just work for incomplete arrays - unsigned Align; - if (const IncompleteArrayType* IAT = - Context.getAsIncompleteArrayType(D->getType())) - Align = Context.getTypeAlign(IAT->getElementType()); - else - Align = Context.getTypeAlign(D->getType()); - if (const AlignedAttr* AA = D->getAttr<AlignedAttr>()) - Align = std::max(Align, AA->getAlignment()); - GV->setAlignment(Align / 8); + GV->setAlignment(getContext().getDeclAlignInBytes(D)); if (const VisibilityAttr *attr = D->getAttr<VisibilityAttr>()) setGlobalVisibility(GV, attr->getVisibility()); |