aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ARCMigrate/TransProperties.cpp10
-rw-r--r--test/ARCMT/GC-no-arc-runtime.m.result2
-rw-r--r--test/ARCMT/GC.m.result2
-rw-r--r--test/ARCMT/assign-prop-with-arc-runtime.m.result10
-rw-r--r--test/ARCMT/releases-driver.m.result2
-rw-r--r--test/ARCMT/releases.m.result2
-rw-r--r--test/ARCMT/remove-dealloc-method.m.result8
-rw-r--r--test/ARCMT/remove-dealloc-zerouts.m.result10
-rw-r--r--test/ARCMT/retains.m.result2
9 files changed, 25 insertions, 23 deletions
diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp
index f8bc8a3c5f..b36acbb205 100644
--- a/lib/ARCMigrate/TransProperties.cpp
+++ b/lib/ARCMigrate/TransProperties.cpp
@@ -50,7 +50,7 @@ class PropertiesRewriter {
enum PropActionKind {
PropAction_None,
- PropAction_RetainRemoved,
+ PropAction_RetainReplacedWithStrong,
PropAction_AssignRemoved,
PropAction_AssignRewritten,
PropAction_MaybeAddWeakOrUnsafe
@@ -161,9 +161,11 @@ private:
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:
@@ -193,7 +195,7 @@ private:
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);
diff --git a/test/ARCMT/GC-no-arc-runtime.m.result b/test/ARCMT/GC-no-arc-runtime.m.result
index 8493b0de7b..983af62c4a 100644
--- a/test/ARCMT/GC-no-arc-runtime.m.result
+++ b/test/ARCMT/GC-no-arc-runtime.m.result
@@ -26,7 +26,7 @@ void test1(CFTypeRef *cft) {
@end
@interface I2
-@property id prop;
+@property (strong) id prop;
@end
@implementation I2
diff --git a/test/ARCMT/GC.m.result b/test/ARCMT/GC.m.result
index 0df6aa89e8..2cf6b8e244 100644
--- a/test/ARCMT/GC.m.result
+++ b/test/ARCMT/GC.m.result
@@ -26,7 +26,7 @@ void test1(CFTypeRef *cft) {
@end
@interface I2
-@property id prop;
+@property (strong) id prop;
@end
@implementation I2
diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m.result b/test/ARCMT/assign-prop-with-arc-runtime.m.result
index 9551e305a1..30a9caa844 100644
--- a/test/ARCMT/assign-prop-with-arc-runtime.m.result
+++ b/test/ARCMT/assign-prop-with-arc-runtime.m.result
@@ -38,9 +38,9 @@ typedef _NSCachedAttributedString *BadClassForWeak;
@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
@@ -58,12 +58,12 @@ typedef _NSCachedAttributedString *BadClassForWeak;
@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
diff --git a/test/ARCMT/releases-driver.m.result b/test/ARCMT/releases-driver.m.result
index 14aecce8e9..70c0aecaf4 100644
--- a/test/ARCMT/releases-driver.m.result
+++ b/test/ARCMT/releases-driver.m.result
@@ -20,7 +20,7 @@ id IhaveSideEffect();
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(void)test:(id)obj;
@end
diff --git a/test/ARCMT/releases.m.result b/test/ARCMT/releases.m.result
index 2b6240b10e..556610ab2a 100644
--- a/test/ARCMT/releases.m.result
+++ b/test/ARCMT/releases.m.result
@@ -20,7 +20,7 @@ id IhaveSideEffect();
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(void)test:(id)obj;
@end
diff --git a/test/ARCMT/remove-dealloc-method.m.result b/test/ARCMT/remove-dealloc-method.m.result
index 5e1efa8687..47e31f9d24 100644
--- a/test/ARCMT/remove-dealloc-method.m.result
+++ b/test/ARCMT/remove-dealloc-method.m.result
@@ -5,10 +5,10 @@
#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
diff --git a/test/ARCMT/remove-dealloc-zerouts.m.result b/test/ARCMT/remove-dealloc-zerouts.m.result
index c857760bc3..9ae831abac 100644
--- a/test/ARCMT/remove-dealloc-zerouts.m.result
+++ b/test/ARCMT/remove-dealloc-zerouts.m.result
@@ -3,10 +3,10 @@
// 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
@@ -23,7 +23,7 @@
@end
@interface Bar
-@property Foo *a;
+@property (strong) Foo *a;
- (void) setA:(Foo*) val;
- (id) a;
@end
diff --git a/test/ARCMT/retains.m.result b/test/ARCMT/retains.m.result
index 19f8972942..2011e50636 100644
--- a/test/ARCMT/retains.m.result
+++ b/test/ARCMT/retains.m.result
@@ -9,7 +9,7 @@ id IhaveSideEffect();
@interface Foo : NSObject {
id bar;
}
-@property id bar;
+@property (strong) id bar;
-(id)test:(id)obj;
-(id)something;
@end