From: Chris Lattner Date: Wed, 10 Mar 2010 23:59:59 +0000 (+0000) Subject: set alignment on static locals properly, patch by Arnaud de Grandmaison! X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0af9523607754a945b49d8a1ebae6631fc927921;p=clang set alignment on static locals properly, patch by Arnaud de Grandmaison! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98204 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 793a220506..371adad718 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -211,6 +211,8 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D, if (D.getInit()) GV = AddInitializerToGlobalBlockVarDecl(D, GV); + GV->setAlignment(getContext().getDeclAlign(&D).getQuantity()); + // FIXME: Merge attribute handling. if (const AnnotateAttr *AA = D.getAttr()) { SourceManager &SM = CGM.getContext().getSourceManager();