summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit5c8f6c47c40d6ddef9015ebfb7dc702799abab53 (patch)
tree2595c0813fcad0be3cf4d208952a4aa8a5bae9fb /clang/lib
parent91ca10fe642caef5bcbbf968cef99714e8112d2d (diff)
downloadbcm5719-llvm-5c8f6c47c40d6ddef9015ebfb7dc702799abab53.tar.gz
bcm5719-llvm-5c8f6c47c40d6ddef9015ebfb7dc702799abab53.zip
Emit block capture initializers as if they were normal initializers for a local
variable that just happens to be stored in a wierd place. llvm-svn: 127235
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 937cece9c0b..68bc8b7d355 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud