]> granicus.if.org Git - clang/commitdiff
Emit block capture initializers as if they were normal initializers for a local
authorJohn McCall <rjmccall@apple.com>
Tue, 8 Mar 2011 09:38:48 +0000 (09:38 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 8 Mar 2011 09:38:48 +0000 (09:38 +0000)
variable that just happens to be stored in a wierd place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127235 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp

index 937cece9c0b25196d019936e0fc90ab1e3630f79..68bc8b7d3559b6d4e3da060692f1c160eb81f187 100644 (file)
@@ -630,7 +630,9 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const BlockExpr *blockExpr) {
 
       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