From 1197c6586a401bac20ca843f409916a215fd14df Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 8 Aug 2013 21:20:01 +0000 Subject: [PATCH] ObjectiveC migrator: tighten rule about when to migrate to @property with getter name starting with 'is'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188013 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/ObjCMT.cpp | 4 ++-- test/ARCMT/objcmt-property.m | 4 ++-- test/ARCMT/objcmt-property.m.result | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 931f6ed051..14d5cf6112 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -318,10 +318,10 @@ void ObjCMigrateASTConsumer::migrateObjCInterfaceDecl(ASTContext &Ctx, if (!SetterMethod) { // try a different naming convention for getter: isXxxxx StringRef getterNameString = getterName->getName(); - if (getterNameString.startswith("is")) { + if (getterNameString.startswith("is") && !GRT->isObjCRetainableType()) { GetterHasIsPrefix = true; const char *CGetterName = getterNameString.data() + 2; - if (CGetterName[0]) { + if (CGetterName[0] && isUppercase(CGetterName[0])) { getterName = &Ctx.Idents.get(CGetterName); SetterSelector = SelectorTable::constructSetterSelector(PP.getIdentifierTable(), diff --git a/test/ARCMT/objcmt-property.m b/test/ARCMT/objcmt-property.m index 8453999cd2..9a8bfa5aaf 100644 --- a/test/ARCMT/objcmt-property.m +++ b/test/ARCMT/objcmt-property.m @@ -85,6 +85,6 @@ typedef char BOOL; - (id) isAnObject; - (void)setAnObject : (id) object; -- (id)isxdelegateYYY; -- (void)setXdelegateYYY:(id)delegate; +- (BOOL) isinValid; +- (void) setInValid : (BOOL) arg; @end diff --git a/test/ARCMT/objcmt-property.m.result b/test/ARCMT/objcmt-property.m.result index 1cd771a1c7..dcdf0da773 100644 --- a/test/ARCMT/objcmt-property.m.result +++ b/test/ARCMT/objcmt-property.m.result @@ -82,9 +82,9 @@ typedef char BOOL; @property(getter=isContinuous) BOOL continuous; -@property(getter=isAnObject, retain) id anObject; - - -@property(getter=isxdelegateYYY, unsafe_unretained) id xdelegateYYY; +- (id) isAnObject; +- (void)setAnObject : (id) object; +- (BOOL) isinValid; +- (void) setInValid : (BOOL) arg; @end -- 2.40.0