[llvm-branch-commits] [cfe-tag] r96982 - /cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp

Jon Ziegler jonz at apple.com
Tue Feb 23 13:01:08 PST 2010


Author: jonz
Date: Tue Feb 23 15:01:08 2010
New Revision: 96982

URL: http://llvm.org/viewvc/llvm-project?rev=96982&view=rev
Log:
>From Fariborz (r96501 on trunk):
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).

Modified:
    cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp

Modified: cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp?rev=96982&r1=96981&r2=96982&view=diff
==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/lib/CodeGen/CGBlocks.cpp Tue Feb 23 15:01:08 2010
@@ -110,19 +110,6 @@
 /// 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)





More information about the llvm-branch-commits mailing list