diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-02-22 03:23:43 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-02-22 03:23:43 +0000 |
| commit | 34ef3057599709cf39c34d5dbac7f9f240408216 (patch) | |
| tree | 044a7bfec8930de2c184fa4b404a95251d42fd76 /clang/lib/CodeGen | |
| parent | 19a546c15b246770a7c1f495bc3582f0b9ac91ae (diff) | |
| download | bcm5719-llvm-34ef3057599709cf39c34d5dbac7f9f240408216.tar.gz bcm5719-llvm-34ef3057599709cf39c34d5dbac7f9f240408216.zip | |
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.
llvm-svn: 65259
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index ea69a66b055..0ca2ad351c9 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/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. |

