[cfe-commits] r127235 - /cfe/trunk/lib/CodeGen/CGBlocks.cpp

John McCall rjmccall at apple.com
Tue Mar 8 01:38:48 PST 2011


Author: rjmccall
Date: Tue Mar  8 03:38:48 2011
New Revision: 127235

URL: http://llvm.org/viewvc/llvm-project?rev=127235&view=rev
Log:
Emit block capture initializers as if they were normal initializers for a local
variable that just happens to be stored in a wierd place.


Modified:
    cfe/trunk/lib/CodeGen/CGBlocks.cpp

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=127235&r1=127234&r2=127235&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Tue Mar  8 03:38:48 2011
@@ -630,7 +630,9 @@
 
       ImplicitCastExpr l2r(ImplicitCastExpr::OnStack, type, CK_LValueToRValue,
                            declRef, VK_RValue);
-      EmitAnyExprToMem(&l2r, blockField, /*volatile*/ false, /*init*/ true);
+      EmitExprAsInit(&l2r, variable, blockField,
+                     getContext().getDeclAlign(variable),
+                     /*captured by init*/ false);
     }
 
     // Push a destructor if necessary.  The semantics for when this





More information about the cfe-commits mailing list