[cfe-commits] r65259 - /cfe/trunk/lib/CodeGen/CGDecl.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Feb 21 19:23:44 PST 2009
Author: efriedma
Date: Sat Feb 21 21:23:43 2009
New Revision: 65259
URL: http://llvm.org/viewvc/llvm-project?rev=65259&view=rev
Log:
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.
Modified:
cfe/trunk/lib/CodeGen/CGDecl.cpp
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=65259&r1=65258&r2=65259&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sat Feb 21 21:23:43 2009
@@ -172,10 +172,7 @@
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.
More information about the cfe-commits
mailing list