aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-12-04 21:22:13 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-12-04 21:22:13 +0000
commit3cd1ea32c312dee47432dbb982f83bccff7356ac (patch)
tree2c4680dd645b61d8c04173d35815e59701521945 /lib/Rewrite/RewriteObjC.cpp
parentfd569004b78124c1041feee75a1e311166268c8d (diff)
Fix rewriter to match recent changes in property ref
AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 286ac0f638..d689f22f68 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -1361,12 +1361,20 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitGetter(Expr *PropOrGetterRefExpr) {
if (!PropParentMap)
PropParentMap = new ParentMap(CurrentBody);
-
+ bool NestedPropertyRef = false;
Stmt *Parent = PropParentMap->getParent(PropOrGetterRefExpr);
- if (Parent && isa<ObjCPropertyRefExpr>(Parent)) {
+ ImplicitCastExpr*ICE=0;
+ if (Parent)
+ if ((ICE = dyn_cast<ImplicitCastExpr>(Parent))) {
+ assert((ICE->getCastKind() == CK_GetObjCProperty)
+ && "RewritePropertyOrImplicitGetter");
+ Parent = PropParentMap->getParent(Parent);
+ NestedPropertyRef = (Parent && isa<ObjCPropertyRefExpr>(Parent));
+ }
+ if (NestedPropertyRef) {
// We stash away the ReplacingStmt since actually doing the
// replacement/rewrite won't work for nested getters (e.g. obj.p.i)
- PropGetters[PropOrGetterRefExpr] = ReplacingStmt;
+ PropGetters[ICE] = ReplacingStmt;
// NOTE: We don't want to call MsgExpr->Destroy(), as it holds references
// to things that stay around.
Context->Deallocate(MsgExpr);