From 083c25eea14bb4cc4ecc3ec763c60e2e609e22bd Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Thu, 22 Oct 2009 00:49:09 +0000 Subject: 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 --- lib/CodeGen/CGBlocks.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CGBlocks.cpp') 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, -- cgit v1.2.3