summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-14 16:04:05 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-14 16:04:05 +0000
commit681c0754d92a8c2f7f94a7255fb2b517eb2857a1 (patch)
tree130fc7767be2fe30277be3b2389c1a623c073f72 /clang/lib/CodeGen/CGBlocks.cpp
parentb7fd763369f8e10a1d0dcab85351572dea374ace (diff)
downloadbcm5719-llvm-681c0754d92a8c2f7f94a7255fb2b517eb2857a1.tar.gz
bcm5719-llvm-681c0754d92a8c2f7f94a7255fb2b517eb2857a1.zip
Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 35a2ada9741..ca78781ec65 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud