diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-14 16:04:05 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-14 16:04:05 +0000 |
commit | 8ac2d449820fd0df00fcbde5bf82165c1f49854d (patch) | |
tree | e776d338a9bd913adb7265519b84826f371b897b /lib/CodeGen/CGBlocks.cpp | |
parent | 44270d6abff30415cdd873164823f48a45be7f8c (diff) |
Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 35a2ada974..ca78781ec6 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -122,12 +122,19 @@ static void CollectBlockDeclRefInfo(const Stmt *S, CGBlockInfo &Info) { E->getReceiverKind() == ObjCMessageExpr::SuperInstance) Info.NeedsObjCSelf = true; } - - // Getter/setter uses may also cause implicit super references, - // which we can check for with: - else if (isa<ObjCSuperExpr>(S)) - Info.NeedsObjCSelf = true; - + else if (const ObjCPropertyRefExpr *PE = dyn_cast<ObjCPropertyRefExpr>(S)) { + // Getter/setter uses may also cause implicit super references, + // which we can check for with: + if (PE->isSuperReceiver()) + Info.NeedsObjCSelf = true; + } + else if (const ObjCImplicitSetterGetterRefExpr *IE = + dyn_cast<ObjCImplicitSetterGetterRefExpr>(S)) { + // Getter/setter uses may also cause implicit super references, + // which we can check for with: + if (IE->isSuperReceiver()) + Info.NeedsObjCSelf = true; + } else if (isa<CXXThisExpr>(S)) Info.CXXThisRef = cast<CXXThisExpr>(S); } |