summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-10 23:59:59 +0000
committerChris Lattner <sabre@nondot.org>2010-03-10 23:59:59 +0000
commit4d941099035522ded975b6392a64fa9663af317e (patch)
tree5bdb3308930527bfb03625624a7a2d266be6978b /clang/lib/CodeGen
parent4ec0b670d5f4d5f4f404cd433b83dccb7b2b005e (diff)
downloadbcm5719-llvm-4d941099035522ded975b6392a64fa9663af317e.tar.gz
bcm5719-llvm-4d941099035522ded975b6392a64fa9663af317e.zip
set alignment on static locals properly, patch by Arnaud de Grandmaison!
llvm-svn: 98204
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 793a2205067..371adad718b 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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<AnnotateAttr>()) {
SourceManager &SM = CGM.getContext().getSourceManager();
OpenPOWER on IntegriCloud