r185599 - [ObjectiveC migrator] relax the rules for setter/getter
Fariborz Jahanian
fjahanian at apple.com
Wed Jul 3 17:24:32 PDT 2013
Author: fjahanian
Date: Wed Jul 3 19:24:32 2013
New Revision: 185599
URL: http://llvm.org/viewvc/llvm-project?rev=185599&view=rev
Log:
[ObjectiveC migrator] relax the rules for setter/getter
types when deciding on validity of a property
inclusion. // rdar://14345082
Modified:
cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=185599&r1=185598&r2=185599&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Wed Jul 3 19:24:32 2013
@@ -211,9 +211,14 @@ void ObjCMigrateASTConsumer::migrateObjC
if (!SRT->isVoidType())
continue;
const ParmVarDecl *argDecl = *SetterMethod->param_begin();
- // FIXME. Can relax rule for matching getter/setter type further.
- if (!Ctx.hasSameType(argDecl->getType(), GRT))
- continue;
+ QualType ArgType = argDecl->getType();
+ if (!Ctx.hasSameType(ArgType, GRT)) {
+ bool Valid =
+ ((GRT->isObjCIdType() && ArgType->isObjCObjectPointerType())
+ || (ArgType->isObjCIdType() && GRT->isObjCObjectPointerType()));
+ if (!Valid)
+ continue;
+ }
// we have a matching setter/getter pair.
// TODO. synthesize a suitable property declaration here.
}
More information about the cfe-commits
mailing list