llvm::SmallVector<Expr *, 1> ExprVec;
ExprVec.push_back(newStmt);
- if (Expr *Exp = dyn_cast<Expr>(Receiver))
- if (PropGetters[Exp])
- // This allows us to handle chain/nested property/implicit getters.
- Receiver = PropGetters[Exp];
-
ObjCMessageExpr *MsgExpr;
if (Super)
MsgExpr = ObjCMessageExpr::Create(*Context,
Sel, OMD,
&ExprVec[0], 1,
/*FIXME:*/SourceLocation());
- else
+ else {
+ // FIXME. Refactor this into common code with that in
+ // RewritePropertyOrImplicitGetter
+ assert(Receiver && "RewritePropertyOrImplicitSetter - null Receiver");
+ if (Expr *Exp = dyn_cast<Expr>(Receiver))
+ if (PropGetters[Exp])
+ // This allows us to handle chain/nested property/implicit getters.
+ Receiver = PropGetters[Exp];
+
MsgExpr = ObjCMessageExpr::Create(*Context,
Ty.getNonReferenceType(),
/*FIXME: */SourceLocation(),
Sel, OMD,
&ExprVec[0], 1,
/*FIXME:*/SourceLocation());
+ }
Stmt *ReplacingStmt = SynthMessageExpr(MsgExpr);
// Now do the actual rewrite.
assert (OMD && "RewritePropertyOrImplicitGetter - OMD is null");
- if (Expr *Exp = dyn_cast<Expr>(Receiver))
- if (PropGetters[Exp])
- // This allows us to handle chain/nested property/implicit getters.
- Receiver = PropGetters[Exp];
-
ObjCMessageExpr *MsgExpr;
if (Super)
MsgExpr = ObjCMessageExpr::Create(*Context,
Sel, OMD,
0, 0,
/*FIXME:*/SourceLocation());
- else
+ else {
+ assert (Receiver && "RewritePropertyOrImplicitGetter - Receiver is null");
+ if (Expr *Exp = dyn_cast<Expr>(Receiver))
+ if (PropGetters[Exp])
+ // This allows us to handle chain/nested property/implicit getters.
+ Receiver = PropGetters[Exp];
MsgExpr = ObjCMessageExpr::Create(*Context,
Ty.getNonReferenceType(),
/*FIXME:*/SourceLocation(),
Sel, OMD,
0, 0,
/*FIXME:*/SourceLocation());
+ }
Stmt *ReplacingStmt = SynthMessageExpr(MsgExpr);