aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-02-17 19:54:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-02-17 19:54:08 +0000
commit0b63ba4d4642467529afbddc227a06979b6080fb (patch)
treeb14b879766a4a443a1535d653970faa1919dc0eb /lib/CodeGen/CGBlocks.cpp
parent56bddeda24adcb927dd5ceafd75f84ebc2eb4203 (diff)
Patch to remove arbitrary imporation of 'self' into
a block without it being used. This causes over release of objects in certain runtime-senitive apps. (fixes radar 7581175). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 46b62441d6..2f0961326a 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -110,19 +110,6 @@ static bool CanBlockBeGlobal(const CodeGenFunction::BlockInfo &Info) {
/// invoke function.
static void AllocateAllBlockDeclRefs(const CodeGenFunction::BlockInfo &Info,
CodeGenFunction *CGF) {
- // Always allocate self, as it is often handy in the debugger, even if there
- // is no codegen in the block that uses it. This is also useful to always do
- // this as if we didn't, we'd have to figure out all code that uses a self
- // pointer, including implicit uses.
- if (const ObjCMethodDecl *OMD
- = dyn_cast_or_null<ObjCMethodDecl>(CGF->CurFuncDecl)) {
- ImplicitParamDecl *SelfDecl = OMD->getSelfDecl();
- BlockDeclRefExpr *BDRE = new (CGF->getContext())
- BlockDeclRefExpr(SelfDecl,
- SelfDecl->getType(), SourceLocation(), false);
- CGF->AllocateBlockDecl(BDRE);
- }
-
// FIXME: Also always forward the this pointer in C++ as well.
for (size_t i = 0; i < Info.DeclRefs.size(); ++i)