From bffd89b0b008132550c9a892a745fc1a7932dae4 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 24 Sep 2013 21:27:58 +0000 Subject: [PATCH] ObjectiveC migrator: provide space between the property keyword and the rest on suggested property. // rdar://15069044 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191335 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/ObjCMT.cpp | 2 +- test/ARCMT/objcmt-arc-cf-annotations.m.result | 4 +- test/ARCMT/objcmt-property.m.result | 92 +++++++++---------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 871c8ece05..a82ac97e00 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -252,7 +252,7 @@ static bool rewriteToObjCProperty(const ObjCMethodDecl *Getter, const NSAPI &NS, edit::Commit &commit, unsigned LengthOfPrefix) { ASTContext &Context = NS.getASTContext(); - std::string PropertyString = "@property(nonatomic"; + std::string PropertyString = "@property (nonatomic"; std::string PropertyNameString = Getter->getNameAsString(); StringRef PropertyName(PropertyNameString); if (LengthOfPrefix > 0) { diff --git a/test/ARCMT/objcmt-arc-cf-annotations.m.result b/test/ARCMT/objcmt-arc-cf-annotations.m.result index 63e39abb96..9a744d6f5f 100644 --- a/test/ARCMT/objcmt-arc-cf-annotations.m.result +++ b/test/ARCMT/objcmt-arc-cf-annotations.m.result @@ -2088,8 +2088,8 @@ void rdar13783514(xpc_connection_t connection) { CFAttributedStringRef CFAttributedCreate(void *CFObj CF_CONSUMED) CF_RETURNS_RETAINED; @interface Action -@property(nonatomic) SEL action; +@property (nonatomic) SEL action; -@property(nonatomic, unsafe_unretained) id target; +@property (nonatomic, unsafe_unretained) id target; @end diff --git a/test/ARCMT/objcmt-property.m.result b/test/ARCMT/objcmt-property.m.result index b5625f9850..ace9c67e48 100644 --- a/test/ARCMT/objcmt-property.m.result +++ b/test/ARCMT/objcmt-property.m.result @@ -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,108 +56,108 @@ 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", // or have exact name "target" have unsafe_unretained attribute. @interface NSInvocation -@property(nonatomic, unsafe_unretained) id target; +@property (nonatomic, unsafe_unretained) id target; -@property(nonatomic, unsafe_unretained) id dataSource; +@property (nonatomic, unsafe_unretained) id dataSource; -@property(nonatomic, unsafe_unretained) id xxxdelegateYYY; +@property (nonatomic, unsafe_unretained) id xxxdelegateYYY; -@property(nonatomic, retain) id MYtarget; +@property (nonatomic, retain) id MYtarget; -@property(nonatomic, retain) id targetX; +@property (nonatomic, retain) id targetX; -@property(nonatomic) int value; +@property (nonatomic) int value; -@property(nonatomic, getter=isContinuous) BOOL continuous; +@property (nonatomic, getter=isContinuous) BOOL continuous; - (id) isAnObject; - (void)setAnObject : (id) object; -@property(nonatomic, getter=isinValid, readonly) BOOL inValid; +@property (nonatomic, getter=isinValid, readonly) BOOL inValid; - (void) setInValid : (BOOL) arg; - (void) Nothing; -@property(nonatomic, readonly) int Length; -@property(nonatomic, readonly) id object; +@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, getter=isIgnoringInteractionEvents, readonly) BOOL ignoringInteractionEvents; +@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=getCounterValue, readonly) BOOL counterValue; +@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 -@property(nonatomic, getter=getM, readonly) BOOL m; -@property(nonatomic, getter=getMA, readonly) BOOL MA; -@property(nonatomic, getter=getALL, readonly) BOOL ALL; -@property(nonatomic, getter=getMANY, readonly) BOOL MANY; -@property(nonatomic, getter=getSome, readonly) BOOL some; +@property (nonatomic, getter=getM, readonly) BOOL m; +@property (nonatomic, getter=getMA, readonly) BOOL MA; +@property (nonatomic, getter=getALL, readonly) BOOL ALL; +@property (nonatomic, getter=getMANY, readonly) BOOL MANY; +@property (nonatomic, getter=getSome, readonly) BOOL some; @end @interface NSInvocation(CAT) -@property(nonatomic, unsafe_unretained) id target; +@property (nonatomic, unsafe_unretained) id target; -@property(nonatomic, unsafe_unretained) id dataSource; +@property (nonatomic, unsafe_unretained) id dataSource; -@property(nonatomic, unsafe_unretained) id xxxdelegateYYY; +@property (nonatomic, unsafe_unretained) id xxxdelegateYYY; -@property(nonatomic, retain) id MYtarget; +@property (nonatomic, retain) id MYtarget; -@property(nonatomic, retain) id targetX; +@property (nonatomic, retain) id targetX; -@property(nonatomic) int value; +@property (nonatomic) int value; -@property(nonatomic, getter=isContinuous) BOOL continuous; +@property (nonatomic, getter=isContinuous) BOOL continuous; - (id) isAnObject; - (void)setAnObject : (id) object; -@property(nonatomic, getter=isinValid, readonly) BOOL inValid; +@property (nonatomic, getter=isinValid, readonly) BOOL inValid; - (void) setInValid : (BOOL) arg; - (void) Nothing; -@property(nonatomic, readonly) int Length; -@property(nonatomic, readonly) id object; +@property (nonatomic, readonly) int Length; +@property (nonatomic, readonly) id object; + (double) D; - (BOOL)is3bar; // watch out - (NSString *)get3foo; // watch out -@property(nonatomic, getter=getM, readonly) BOOL m; -@property(nonatomic, getter=getMA, readonly) BOOL MA; -@property(nonatomic, getter=getALL, readonly) BOOL ALL; -@property(nonatomic, getter=getMANY, readonly) BOOL MANY; -@property(nonatomic, getter=getSome, readonly) BOOL some; +@property (nonatomic, getter=getM, readonly) BOOL m; +@property (nonatomic, getter=getMA, readonly) BOOL MA; +@property (nonatomic, getter=getALL, readonly) BOOL ALL; +@property (nonatomic, getter=getMANY, readonly) BOOL MANY; +@property (nonatomic, getter=getSome, readonly) BOOL some; @end DEPRECATED @@ -187,14 +187,14 @@ 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. - (NSURL *)appStoreReceiptURLY ; - (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE; -@property(nonatomic, readonly) id OkToInfer NS_AVAILABLE; +@property (nonatomic, readonly) id OkToInfer NS_AVAILABLE; // Do not infer a property. - (NSURL *)appStoreReceiptURLZ ; @@ -204,7 +204,7 @@ DEPRECATED - (id) t1 NORETURN NS_AVAILABLE; - (void) setT1 : (id) arg NS_AVAILABLE; -@property(nonatomic, retain) id method1 ALIGNED NS_AVAILABLE; +@property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE; @end -- 2.40.0