diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-29 20:27:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-29 20:27:13 +0000 |
commit | 4e1524babb095e70de1da882573eb6fbee98a857 (patch) | |
tree | 942a625d2cbc13f874123b051d462d2f4c1f4d48 /lib/CodeGen/CGObjC.cpp | |
parent | 52f127297c9dca0f8fbb3a28144de4db1d1db9e2 (diff) |
revert r149184
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 49979f3279..446bef1249 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -136,7 +136,7 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E, bool isDelegateInit = E->isDelegateInitCall(); const ObjCMethodDecl *method = E->getMethodDecl(); - + // We don't retain the receiver in delegate init calls, and this is // safe because the receiver value is always loaded from 'self', // which we zero out. We don't want to Block_copy block receivers, @@ -191,19 +191,6 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E, break; } - // Check to see if receiver must be null checked before method is sent - // to the receiver. - NullReturnState nullReturn; - if (CGM.getLangOptions().ObjCAutoRefCount && method) - for (ObjCMethodDecl::param_const_iterator i = method->param_begin(), - e = method->param_end(); i != e; ++i) { - const ParmVarDecl *ParamDecl = (*i); - if (ParamDecl->hasAttr<NSConsumedAttr>()) { - nullReturn.init(*this, Receiver); - break; - } - } - if (retainSelf) Receiver = EmitARCRetainNonBlock(Receiver); @@ -275,8 +262,8 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E, Builder.CreateStore(newSelf, selfAddr); } - RValue rvalue = AdjustRelatedResultType(*this, E, method, result); - return nullReturn.complete(*this, rvalue, ResultType); + + return AdjustRelatedResultType(*this, E, method, result); } namespace { @@ -305,7 +292,6 @@ struct FinishARCDealloc : EHScopeStack::Cleanup { method); } }; - } /// StartObjCMethod - Begin emission of an ObjCMethod. This generates |