summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-07-05 20:46:03 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-07-05 20:46:03 +0000
commit266926d85ea7a6ed91c13b83095938325d4da179 (patch)
treed905d99b6751ad199605ad0661146c8c10ffe444
parente283e1958afb9c3eefeb142c4383de3286786150 (diff)
downloadbcm5719-llvm-266926d85ea7a6ed91c13b83095938325d4da179.tar.gz
bcm5719-llvm-266926d85ea7a6ed91c13b83095938325d4da179.zip
[objc migrator]: More knobs to do migration to
use of objc's properties. llvm-svn: 185724
-rw-r--r--clang/include/clang/Edit/Rewriters.h5
-rw-r--r--clang/lib/ARCMigrate/ObjCMT.cpp12
-rw-r--r--clang/lib/Edit/RewriteObjCFoundationAPI.cpp6
3 files changed, 15 insertions, 8 deletions
diff --git a/clang/include/clang/Edit/Rewriters.h b/clang/include/clang/Edit/Rewriters.h
index 292878e7569..cfb59dfa32c 100644
--- a/clang/include/clang/Edit/Rewriters.h
+++ b/clang/include/clang/Edit/Rewriters.h
@@ -12,6 +12,7 @@
namespace clang {
class ObjCMessageExpr;
+ class ObjCMethodDecl;
class NSAPI;
class ParentMap;
@@ -24,6 +25,10 @@ bool rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg,
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);
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp
index 696666ecde7..ec19f6e8f06 100644
--- a/clang/lib/ARCMigrate/ObjCMT.cpp
+++ b/clang/lib/ARCMigrate/ObjCMT.cpp
@@ -212,15 +212,11 @@ void ObjCMigrateASTConsumer::migrateObjCInterfaceDecl(ASTContext &Ctx,
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);
}
}
}
diff --git a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
index f4206fbd8f4..9af53037eac 100644
--- a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
+++ b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
@@ -355,6 +355,12 @@ bool edit::rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg,
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.
OpenPOWER on IntegriCloud