}
-static bool rewriteToObjCProperty(const ObjCMethodDecl *Getter,
+static void rewriteToObjCProperty(const ObjCMethodDecl *Getter,
const ObjCMethodDecl *Setter,
const NSAPI &NS, edit::Commit &commit,
unsigned LengthOfPrefix,
SourceLocation EndLoc = Setter->getDeclaratorEndLoc();
// Get location past ';'
EndLoc = EndLoc.getLocWithOffset(1);
- commit.remove(CharSourceRange::getCharRange(Setter->getLocStart(), EndLoc));
+ SourceLocation BeginOfSetterDclLoc = Setter->getLocStart();
+ // FIXME. This assumes that setter decl; is immediately preceeded by eoln.
+ // It is trying to remove the setter method decl. line entirely.
+ BeginOfSetterDclLoc = BeginOfSetterDclLoc.getLocWithOffset(-1);
+ commit.remove(SourceRange(BeginOfSetterDclLoc, EndLoc));
}
- return true;
}
void ObjCMigrateASTConsumer::migrateObjCInterfaceDecl(ASTContext &Ctx,
@interface Action
@property (nonatomic) SEL action;
-
@property (nonatomic, assign) id target;
-
@end
@interface I : NSObject {
int ivarVal;
}
-
@property (weak) NSString *WeakProp;
@property (retain) NSString *StrongProp;
-
- (NSString *) UnavailProp __attribute__((unavailable));
- (void) setUnavailProp : (NSString *)Val;
@property (retain) NSString *UnavailProp1 __attribute__((unavailable));
-
- (NSString *) UnavailProp2;
- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
@property (copy) NSDictionary *undoAction;
-
@end
@implementation I
NSArray *_names3;
NSArray *_names4;
}
-
-
-
-
@property (retain) NSArray *names2;
@property (retain) NSArray *names3;
@property (retain) NSArray *names4;
@interface NSInvocation
@property (assign) id target;
-
@property (assign) id dataSource;
@property (assign) id xxxdelegateYYY;
-
-
@property (retain) id MYtarget;
-
@property (retain) id targetX;
-
@property int value;
-
@property (getter=isContinuous) BOOL continuous;
-
- (id) isAnObject;
- (void)setAnObject : (id) object;
@property (getter=getStringValue, retain) NSString *stringValue;
@property (getter=getCounterValue, readonly) BOOL counterValue;
-
@property (getter=getns_dixtionary, readonly) NSDictionary *ns_dixtionary;
- (BOOL)is3bar; // watch out
@interface NSInvocation(CAT)
@property (assign) id target;
-
@property (assign) id dataSource;
@property (assign) id xxxdelegateYYY;
-
-
@property (retain) id MYtarget;
-
@property (retain) id targetX;
-
@property int value;
-
@property (getter=isContinuous) BOOL continuous;
-
- (id) isAnObject;
- (void)setAnObject : (id) object;
@property (retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
-
// Do not infer a property.
- (NSURL *)appStoreReceiptURLY ;
- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
@property (retain) id method1 ALIGNED NS_AVAILABLE;
-
- (NSURL *)init; // No Change
+ (id)alloc; // No Change
@interface NSArray
@property (readonly) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
@property (copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
-
@property (readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
@property id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
-
@end
@interface I : NSObject {
int ivarVal;
}
-
@property (nonatomic, weak) NSString *WeakProp;
@property (nonatomic, retain) NSString *StrongProp;
-
- (NSString *) UnavailProp __attribute__((unavailable));
- (void) setUnavailProp : (NSString *)Val;
@property (nonatomic, retain) NSString *UnavailProp1 __attribute__((unavailable));
-
- (NSString *) UnavailProp2;
- (void) setUnavailProp2 : (NSString *)Val __attribute__((unavailable));
@property (nonatomic, copy) NSDictionary *undoAction;
-
@end
@implementation I
NSArray *_names3;
NSArray *_names4;
}
-
-
-
-
@property (nonatomic, retain) NSArray *names2;
@property (nonatomic, retain) NSArray *names3;
@property (nonatomic, retain) NSArray *names4;
@interface NSInvocation
@property (nonatomic, assign) id target;
-
@property (nonatomic, assign) id dataSource;
@property (nonatomic, assign) id xxxdelegateYYY;
-
-
@property (nonatomic, retain) id MYtarget;
-
@property (nonatomic, retain) id targetX;
-
@property (nonatomic) int value;
-
@property (nonatomic, getter=isContinuous) BOOL continuous;
-
- (id) isAnObject;
- (void)setAnObject : (id) object;
@property (nonatomic, getter=getStringValue, retain) NSString *stringValue;
@property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
-
@property (nonatomic, getter=getns_dixtionary, readonly) NSDictionary *ns_dixtionary;
- (BOOL)is3bar; // watch out
@interface NSInvocation(CAT)
@property (nonatomic, assign) id target;
-
@property (nonatomic, assign) id dataSource;
@property (nonatomic, assign) id xxxdelegateYYY;
-
-
@property (nonatomic, retain) id MYtarget;
-
@property (nonatomic, retain) id targetX;
-
@property (nonatomic) int value;
-
@property (nonatomic, getter=isContinuous) BOOL continuous;
-
- (id) isAnObject;
- (void)setAnObject : (id) object;
@property (nonatomic, retain) NSURL *appStoreReceiptURLX NS_AVAILABLE;
-
// Do not infer a property.
- (NSURL *)appStoreReceiptURLY ;
- (void) setAppStoreReceiptURLY : (NSURL *)object NS_AVAILABLE;
@property (nonatomic, retain) id method1 ALIGNED NS_AVAILABLE;
-
- (NSURL *)init; // No Change
+ (id)alloc; // No Change
@interface NSArray
@property (nonatomic, readonly) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *);
@property (nonatomic, copy) id (^MyBlock)(id, NSArray *, NSMutableDictionary *);
-
@property (nonatomic, readonly) id (*expressionFuncptr)(id, NSArray *, NSMutableDictionary *);
@property (nonatomic) id (*MyFuncptr)(id, NSArray *, NSMutableDictionary *);
-
@end
// rdar://15231241