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 | 97e070ed6866b2dfb65bdce84fa0af75cf5b631c (patch) | |
tree | 5b30ca76d5dd835bfbf873b6f1f0f9b5ba451cf9 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 90afd3d4aaba6a18908bdfa55b5c5fd98143e45a (diff) | |
download | bcm5719-llvm-97e070ed6866b2dfb65bdce84fa0af75cf5b631c.tar.gz bcm5719-llvm-97e070ed6866b2dfb65bdce84fa0af75cf5b631c.zip |
Minor cleanup: use getDeclAlignInBytes helper.
llvm-svn: 65611
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 75a8302792a..6ebe12706bd 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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()); |