aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-08 09:38:48 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-08 09:38:48 +0000
commitdf045200e0220f10bf03de05ca878949e0c40a5a (patch)
treee271453bfd96b7b47f81a9925ee89f50394b45c9 /lib/CodeGen/CGBlocks.cpp
parent60d3365b46eb826fba44483583c0051ac5c41fe3 (diff)
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
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp4
1 files changed, 3 insertions, 1 deletions
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