diff options
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); } |