diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-02 17:02:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-02 17:02:11 +0000 |
commit | 830937bc1100fba7682f7c32c40512085870f50c (patch) | |
tree | 4306719d8de4075d9dc2e5efd27a4707566ee6df /lib/CodeGen/CGDecl.cpp | |
parent | fce5656f752199bb99a80fdff9184f9ddb470fc3 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 4032bedbfc..9490769407 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/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); } } |