]> granicus.if.org Git - clang/commitdiff
ObjectiveC migrator. When migrating to property declaration
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Sep 2013 23:18:46 +0000 (23:18 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Sep 2013 23:18:46 +0000 (23:18 +0000)
use Cocoa's naming convention for properties of ObjC
object type. // rdar://15045005

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191240 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/ObjCMT.cpp
test/ARCMT/objcmt-property.m.result

index c29a2de46b5b511b7af030ecbe5333c730c3ad3e..1dd8b0dfbd33f13ee86db15d258f7b100774f7e0 100644 (file)
@@ -304,7 +304,9 @@ static bool rewriteToObjCProperty(const ObjCMethodDecl *Getter,
   }
   PropertyString += " ";
   PropertyString += RT.getAsString(Context.getPrintingPolicy());
-  PropertyString += " ";
+  char LastChar = PropertyString[PropertyString.size()-1]        ;
+  if (LastChar != '*')
+    PropertyString += " ";
   if (LengthOfPrefix > 0) {
     // property name must strip off "is" and lower case the first character
     // after that; e.g. isContinuous will become continuous.
index 30bd028008fb8b28a081e6964213edf38b34a7ca..b5625f9850bde1ca1a4ee1701dbda70028ad1a0e 100644 (file)
@@ -22,21 +22,21 @@ typedef char BOOL;
   int ivarVal;
 }
 
-@property(nonatomic, weak) NSString * WeakProp;
+@property(nonatomic, weak) NSString *WeakProp;
 
-@property(nonatomic, retain) NSString * StrongProp;
+@property(nonatomic, retain) NSString *StrongProp;
 
 
 - (NSString *) UnavailProp  __attribute__((unavailable));
 - (void) setUnavailProp  : (NSString *)Val;
 
-@property(nonatomic, retain) NSString * UnavailProp1  __attribute__((unavailable));
+@property(nonatomic, retain) NSString *UnavailProp1  __attribute__((unavailable));
 
 
 - (NSString *) UnavailProp2;
 - (void) setUnavailProp2  : (NSString *)Val  __attribute__((unavailable));
 
-@property(nonatomic, copy) NSDictionary * undoAction;
+@property(nonatomic, copy) NSDictionary *undoAction;
 
 @end
 
@@ -56,10 +56,10 @@ typedef char BOOL;
 
 
 
-@property(nonatomic, retain) NSArray * names2;
-@property(nonatomic, retain) NSArray * names3;
-@property(nonatomic, retain) NSArray * names4;
-@property(nonatomic, retain) NSArray * names1;
+@property(nonatomic, retain) NSArray *names2;
+@property(nonatomic, retain) NSArray *names3;
+@property(nonatomic, retain) NSArray *names4;
+@property(nonatomic, retain) NSArray *names1;
 @end
 
 // Properties that contain the name "delegate" or "dataSource",
@@ -97,13 +97,13 @@ typedef char BOOL;
 @property(nonatomic, readonly) int Length;
 @property(nonatomic, readonly) id object;
 + (double) D;
-@property(nonatomic, readonly) void * JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
+@property(nonatomic, readonly) void *JSObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER);
 @property(nonatomic, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents;
 
-@property(nonatomic, getter=getStringValue, retain) NSString * stringValue;
+@property(nonatomic, getter=getStringValue, retain) NSString *stringValue;
 @property(nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
 
-@property(nonatomic, getter=getns_dixtionary, readonly) NSDictionary * ns_dixtionary;
+@property(nonatomic, getter=getns_dixtionary, readonly) NSDictionary *ns_dixtionary;
 
 - (BOOL)is3bar; // watch out
 - (NSString *)get3foo; // watch out
@@ -187,7 +187,7 @@ DEPRECATED
 - (NSURL *)appStoreReceiptURL NS_AVAILABLE;
 - (void) setAppStoreReceiptURL : (NSURL *)object;
 
-@property(nonatomic, retain) NSURL * appStoreReceiptURLX NS_AVAILABLE;
+@property(nonatomic, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
 
 
 // Do not infer a property.