From 50198098b95d30dc027ac4f89e77a727b3a25635 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 2 Dec 2010 17:02:11 +0000 Subject: IR Gen. part of API support for __block cxx objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713 --- clang/lib/CodeGen/CGDecl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGDecl.cpp') diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 4032bedbfc8..9490769407d 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -756,6 +756,9 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D, Ty->isObjCObjectPointerType()) { flag |= BLOCK_FIELD_IS_OBJECT; flags |= BLOCK_HAS_COPY_DISPOSE; + } else if (getContext().getBlockVarCopyInits(&D)) { + flag |= BLOCK_HAS_CXX_OBJ; + flags |= BLOCK_HAS_COPY_DISPOSE; } // FIXME: Someone double check this. @@ -781,12 +784,12 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D, SynthesizeCopyDisposeHelpers = true; llvm::Value *copy_helper = Builder.CreateStructGEP(DeclPtr, 4); Builder.CreateStore(BuildbyrefCopyHelper(DeclPtr->getType(), flag, - Align.getQuantity()), + Align.getQuantity(), &D), copy_helper); llvm::Value *destroy_helper = Builder.CreateStructGEP(DeclPtr, 5); Builder.CreateStore(BuildbyrefDestroyHelper(DeclPtr->getType(), flag, - Align.getQuantity()), + Align.getQuantity(), &D), destroy_helper); } } -- cgit v1.2.3