r191347 - ObjectiveC migrator. Don't suggest @property for

Fariborz Jahanian fjahanian at apple.com
Tue Sep 24 17:17:07 PDT 2013


Author: fjahanian
Date: Tue Sep 24 19:17:07 2013
New Revision: 191347

URL: http://llvm.org/viewvc/llvm-project?rev=191347&view=rev
Log:
ObjectiveC migrator. Don't suggest @property for
methods which look like getters but belong to
known family of methods. // rdar://15044058

Modified:
    cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
    cfe/trunk/test/ARCMT/objcmt-property.m
    cfe/trunk/test/ARCMT/objcmt-property.m.result

Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=191347&r1=191346&r2=191347&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Tue Sep 24 19:17:07 2013
@@ -772,6 +772,12 @@ bool ObjCMigrateASTConsumer::migrateProp
     return false;
   
   Selector GetterSelector = Method->getSelector();
+  ObjCInstanceTypeFamily OIT_Family =
+    Selector::getInstTypeMethodFamily(GetterSelector);
+  
+  if (OIT_Family != OIT_None)
+    return false;
+  
   IdentifierInfo *getterName = GetterSelector.getIdentifierInfoForSlot(0);
   Selector SetterSelector =
   SelectorTable::constructSetterSelector(PP.getIdentifierTable(),

Modified: cfe/trunk/test/ARCMT/objcmt-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m?rev=191347&r1=191346&r2=191347&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m Tue Sep 24 19:17:07 2013
@@ -207,4 +207,7 @@ DEPRECATED
 - (id)method1 ALIGNED NS_AVAILABLE;
 - (void) setMethod1 : (id) object NS_AVAILABLE ALIGNED;
 
+- (NSURL *)init;  // No Change
++ (id)alloc;      // No Change
+
 @end

Modified: cfe/trunk/test/ARCMT/objcmt-property.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m.result?rev=191347&r1=191346&r2=191347&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-property.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-property.m.result Tue Sep 24 19:17:07 2013
@@ -207,4 +207,7 @@ DEPRECATED
 @property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE;
 
 
+- (NSURL *)init;  // No Change
++ (id)alloc;      // No Change
+
 @end





More information about the cfe-commits mailing list