From df045200e0220f10bf03de05ca878949e0c40a5a Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 8 Mar 2011 09:38:48 +0000 Subject: [PATCH] Emit block capture initializers as if they were normal initializers for a local 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 937cece9c0..68bc8b7d35 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -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 -- 2.40.0