Reorganize the emission of local variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126189 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index a35648d..83cca93 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -1376,10 +1376,9 @@
                                                     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 @@
                                                        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