aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-02-22 03:23:43 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-02-22 03:23:43 +0000
commit9c2f06b373e6209447baf1fd5a86dd6602c573a8 (patch)
tree0d4bfb777cd70e8c442a570fb477cdcfeddea6e9 /lib/CodeGen/CGDecl.cpp
parentdcdafb6a701aa9d81edcb088915f58933315dc05 (diff)
Last part of PR3254: use the same alignment computation in Sema and
CodeGen. I'm not sure whether this actually makes any visible difference, but it's better to be consistent anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index ea69a66b05..0ca2ad351c 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -172,10 +172,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
const llvm::Type *LTy = ConvertType(Ty);
llvm::AllocaInst *Alloc =
CreateTempAlloca(LTy, CGM.getMangledName(&D));
- unsigned align = getContext().getTypeAlign(Ty);
- if (const AlignedAttr* AA = D.getAttr<AlignedAttr>())
- align = std::max(align, AA->getAlignment());
- Alloc->setAlignment(align >> 3);
+ Alloc->setAlignment(getContext().getDeclAlignInBytes(&D));
DeclPtr = Alloc;
} else {
// Targets that don't support recursion emit locals as globals.