diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-04 00:24:32 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-04 00:24:32 +0000 |
commit | 43bbaaca809935aad4c3b105596989f6530e2a65 (patch) | |
tree | e424b60b606e9062fef4360643080583111d5027 | |
parent | cde3fd87e05cbf1e4f46efce6f8d22105d6f879a (diff) | |
download | bcm5719-llvm-43bbaaca809935aad4c3b105596989f6530e2a65.tar.gz bcm5719-llvm-43bbaaca809935aad4c3b105596989f6530e2a65.zip |
[ObjectiveC migrator] relax the rules for setter/getter
types when deciding on validity of a property
inclusion. // rdar://14345082
llvm-svn: 185599
-rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 8702ac3f8f9..696666ecde7 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/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. } |