]> granicus.if.org Git - clang/commitdiff
ObjectiveC migrator: tighten rule about when to
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 8 Aug 2013 21:20:01 +0000 (21:20 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 8 Aug 2013 21:20:01 +0000 (21:20 +0000)
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
test/ARCMT/objcmt-property.m
test/ARCMT/objcmt-property.m.result

index 931f6ed051f68d3ee31b8e59bc8e6d6cbd464017..14d5cf6112b00fab16b6dd918d04b09c53c55eaf 100644 (file)
@@ -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(),
index 8453999cd25aab2a0e8bb25529c698e313476e69..9a8bfa5aafa611e4edcc3cb4b527f2dd2fec7b1d 100644 (file)
@@ -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
index 1cd771a1c7216653402ce5e885e250ae0f15862e..dcdf0da773c4f99145150cc68b02782acd728cae 100644 (file)
@@ -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