enum PropActionKind {
PropAction_None,
- PropAction_RetainRemoved,
+ PropAction_RetainReplacedWithStrong,
PropAction_AssignRemoved,
PropAction_AssignRewritten,
PropAction_MaybeAddWeakOrUnsafe
switch (kind) {
case PropAction_None:
return;
- case PropAction_RetainRemoved:
- removeAttribute("retain", atLoc);
+ case PropAction_RetainReplacedWithStrong: {
+ StringRef toAttr = "strong";
+ MigrateCtx.rewritePropertyAttribute("retain", toAttr, atLoc);
return;
+ }
case PropAction_AssignRemoved:
return removeAssignForDefaultStrong(props, atLoc);
case PropAction_AssignRewritten:
if (propAttrs & ObjCPropertyDecl::OBJC_PR_retain) {
// strong is the default.
- return doPropAction(PropAction_RetainRemoved, props, atLoc);
+ return doPropAction(PropAction_RetainReplacedWithStrong, props, atLoc);
}
bool HasIvarAssignedAPlusOneObject = hasIvarAssignedAPlusOneObject(props);
@end
@interface I2
-@property id prop;
+@property (strong) id prop;
@end
@implementation I2
@end
@interface I2
-@property id prop;
+@property (strong) id prop;
@end
@implementation I2
@property (weak) Foo *no_user_ivar1;
@property (weak, readonly) Foo *no_user_ivar2;
-@property id def1;
-@property (atomic) id def2;
-@property (atomic) id def3;
+@property (strong) id def1;
+@property (atomic,strong) id def2;
+@property (strong,atomic) id def3;
@end
@end
@interface TestExt
-@property (readonly) TestExt *x1;
+@property (strong,readonly) TestExt *x1;
@property (weak, readonly) TestExt *x2;
@end
@interface TestExt()
-@property (readwrite) TestExt *x1;
+@property (strong,readwrite) TestExt *x1;
@property (weak, readwrite) TestExt *x2;
@end
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(void)test:(id)obj;
@end
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(void)test:(id)obj;
@end
#define nil ((void*) 0)
@interface Foo
-@property id x;
-@property id y;
-@property id w;
-@property id z;
+@property (strong) id x;
+@property (strong) id y;
+@property (strong) id w;
+@property (strong) id z;
@end
@implementation Foo
// RUN: diff %t %s.result
@interface Foo
-@property id x;
-@property id y;
-@property id w;
-@property id z;
+@property (strong) id x;
+@property (strong) id y;
+@property (strong) id w;
+@property (strong) id z;
@property (strong) id q;
@end
@end
@interface Bar
-@property Foo *a;
+@property (strong) Foo *a;
- (void) setA:(Foo*) val;
- (id) a;
@end
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(id)test:(id)obj;
-(id)something;
@end