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
This commit is contained in:
John McCall 2011-03-08 09:38:48 +00:00
parent 91ca10fe64
commit 5c8f6c47c4
1 changed files with 3 additions and 1 deletions

View 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