diff options
author | John McCall <rjmccall@apple.com> | 2011-02-22 06:44:22 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-22 06:44:22 +0000 |
commit | 34695856c0e67b3765b46304cc71b5d2cd5b71c7 (patch) | |
tree | 5a36177f32dd66e838cba9342979ceb83e323f7a /lib/CodeGen/CGBlocks.cpp | |
parent | 0ef473f75426f0a95635d0a9dd567d27b07dbd5b (diff) |
Reorganize the emission of local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index a35648d23d..83cca931ce 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -1376,10 +1376,9 @@ llvm::Constant *CodeGenModule::BuildbyrefCopyHelper(const llvm::Type *T, BlockFieldFlags flags, unsigned align, const VarDecl *var) { - // All alignments below that of pointer alignment collapse down to just - // pointer alignment, as we always have at least that much alignment to begin - // with. - align /= unsigned(getTarget().getPointerAlign(0) / 8); + // All alignments below pointer alignment are bumped up, as we + // always have at least that much alignment to begin with. + if (align < PointerAlignInBytes) align = PointerAlignInBytes; // As an optimization, we only generate a single function of each kind we // might need. We need a different one for each alignment and for each @@ -1396,10 +1395,9 @@ llvm::Constant *CodeGenModule::BuildbyrefDestroyHelper(const llvm::Type *T, BlockFieldFlags flags, unsigned align, const VarDecl *var) { - // All alignments below that of pointer alignment collpase down to just - // pointer alignment, as we always have at least that much alignment to begin - // with. - align /= unsigned(getTarget().getPointerAlign(0) / 8); + // All alignments below pointer alignment are bumped up, as we + // always have at least that much alignment to begin with. + if (align < PointerAlignInBytes) align = PointerAlignInBytes; // As an optimization, we only generate a single function of each kind we // might need. We need a different one for each alignment and for each |