From 52477fb1b86f99a2a8c77e1523d4f186490c28e9 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 4 Jul 2013 00:24:32 +0000 Subject: [PATCH] [ObjectiveC migrator] relax the rules for setter/getter types when deciding on validity of a property inclusion. // rdar://14345082 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185599 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/ObjCMT.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 8702ac3f8f..696666ecde 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -211,9 +211,14 @@ void ObjCMigrateASTConsumer::migrateObjCInterfaceDecl(ASTContext &Ctx, 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. } -- 2.50.1