namespace clang {
class ObjCMessageExpr;
+ class ObjCMethodDecl;
class NSAPI;
class ParentMap;
bool rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit,
const ParentMap *PMap);
+
+bool rewriteToObjCProperty(const ObjCMethodDecl *Getter,
+ const ObjCMethodDecl *Setter,
+ const NSAPI &NS, Commit &commit);
bool rewriteToObjCSubscriptSyntax(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit);
continue;
const ParmVarDecl *argDecl = *SetterMethod->param_begin();
QualType ArgType = argDecl->getType();
- if (!Ctx.hasSameType(ArgType, GRT)) {
- bool Valid =
- ((GRT->isObjCIdType() && ArgType->isObjCObjectPointerType())
- || (ArgType->isObjCIdType() && GRT->isObjCObjectPointerType()));
- if (!Valid)
+ if (!Ctx.hasSameType(ArgType, GRT))
continue;
- }
- // we have a matching setter/getter pair.
- // TODO. synthesize a suitable property declaration here.
+ edit::Commit commit(*Editor);
+ edit::rewriteToObjCProperty(Method, SetterMethod, *NSAPIObj, commit);
+ Editor->commit(commit);
}
}
}
return false;
}
+bool edit::rewriteToObjCProperty(const ObjCMethodDecl *Getter,
+ const ObjCMethodDecl *Setter,
+ const NSAPI &NS, Commit &commit) {
+ return false;
+}
+
/// \brief Returns true if the immediate message arguments of \c Msg should not
/// be rewritten because it will interfere with the rewrite of the parent
/// message expression. e.g.