diff options
author | Mike Stump <mrs@apple.com> | 2009-10-22 00:49:09 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-10-22 00:49:09 +0000 |
commit | 083c25eea14bb4cc4ecc3ec763c60e2e609e22bd (patch) | |
tree | 722fc6df1c643f519bf978f6ffb1ffcd229cc34d /lib/CodeGen/CGBlocks.cpp | |
parent | 080fb19301b1d0ce4149d99b8961e77f7ed4bb2e (diff) |
Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 26b19e56bc..dc4db4ac2c 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -486,8 +486,10 @@ uint64_t CodeGenFunction::AllocateBlockDecl(const BlockDeclRefExpr *E) { return offset; // Don't run the expensive check, unless we have to. - if (!BlockHasCopyDispose && BlockRequiresCopying(E->getType())) - BlockHasCopyDispose = true; + if (!BlockHasCopyDispose) + if (E->isByRef() + || BlockRequiresCopying(E->getType())) + BlockHasCopyDispose = true; // if not, allocate one now. offset = getBlockOffset(E); @@ -680,7 +682,8 @@ CodeGenFunction::GenerateBlockFunction(const BlockExpr *BExpr, // Allocate all BlockDeclRefDecls, so we can calculate the right ParmTy below. AllocateAllBlockDeclRefs(Info, this); - QualType ParmTy = getContext().getBlockParmType(BlockDeclRefDecls); + QualType ParmTy = getContext().getBlockParmType(BlockHasCopyDispose, + BlockDeclRefDecls); // FIXME: This leaks ImplicitParamDecl *SelfDecl = ImplicitParamDecl::Create(getContext(), 0, |