summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-10-22 00:49:09 +0000
committerMike Stump <mrs@apple.com>2009-10-22 00:49:09 +0000
commite1b19ba05b4d30e9b6be08461d82ec95caeb54a7 (patch)
tree513c5bc1264ab176ba691f630bc11db9ac56ad26 /clang/lib/CodeGen/CGBlocks.cpp
parentcc81526176847953f5476fb40c750646a5995777 (diff)
downloadbcm5719-llvm-e1b19ba05b4d30e9b6be08461d82ec95caeb54a7.tar.gz
bcm5719-llvm-e1b19ba05b4d30e9b6be08461d82ec95caeb54a7.zip
Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate. llvm-svn: 84817
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 26b19e56bc2..dc4db4ac2c7 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud