[cfe-commits] r148559 - in /cfe/trunk: lib/ARCMigrate/TransProperties.cpp test/ARCMT/GC-no-arc-runtime.m.result test/ARCMT/GC.m.result test/ARCMT/assign-prop-with-arc-runtime.m.result test/ARCMT/releases-driver.m.result test/ARCMT/releases.m.result test/ARCMT/remove-dealloc-method.m.result test/ARCMT/remove-dealloc-zerouts.m.result test/ARCMT/retains.m.result
Fariborz Jahanian
fjahanian at apple.com
Fri Jan 20 11:15:03 PST 2012
Author: fjahanian
Date: Fri Jan 20 13:15:02 2012
New Revision: 148559
URL: http://llvm.org/viewvc/llvm-project?rev=148559&view=rev
Log:
arc migrator: replace "retain" attribute with "strong"
which have same semantics in mrr as well as arr.
// rdar://10688312
Modified:
cfe/trunk/lib/ARCMigrate/TransProperties.cpp
cfe/trunk/test/ARCMT/GC-no-arc-runtime.m.result
cfe/trunk/test/ARCMT/GC.m.result
cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
cfe/trunk/test/ARCMT/releases-driver.m.result
cfe/trunk/test/ARCMT/releases.m.result
cfe/trunk/test/ARCMT/remove-dealloc-method.m.result
cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result
cfe/trunk/test/ARCMT/retains.m.result
Modified: cfe/trunk/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransProperties.cpp?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransProperties.cpp Fri Jan 20 13:15:02 2012
@@ -50,7 +50,7 @@
enum PropActionKind {
PropAction_None,
- PropAction_RetainRemoved,
+ PropAction_RetainReplacedWithStrong,
PropAction_AssignRemoved,
PropAction_AssignRewritten,
PropAction_MaybeAddWeakOrUnsafe
@@ -161,9 +161,11 @@
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 @@
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);
Modified: cfe/trunk/test/ARCMT/GC-no-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/GC-no-arc-runtime.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/GC-no-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/GC-no-arc-runtime.m.result Fri Jan 20 13:15:02 2012
@@ -26,7 +26,7 @@
@end
@interface I2
- at property id prop;
+ at property (strong) id prop;
@end
@implementation I2
Modified: cfe/trunk/test/ARCMT/GC.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/GC.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/GC.m.result (original)
+++ cfe/trunk/test/ARCMT/GC.m.result Fri Jan 20 13:15:02 2012
@@ -26,7 +26,7 @@
@end
@interface I2
- at property id prop;
+ at property (strong) id prop;
@end
@implementation I2
Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result Fri Jan 20 13:15:02 2012
@@ -38,9 +38,9 @@
@property (weak) Foo *no_user_ivar1;
@property (weak, readonly) Foo *no_user_ivar2;
- at property id def1;
- at property (atomic) id def2;
- at property (atomic) id def3;
+ at property (strong) id def1;
+ at property (atomic,strong) id def2;
+ at property (strong,atomic) id def3;
@end
@@ -58,12 +58,12 @@
@end
@interface TestExt
- at property (readonly) TestExt *x1;
+ at property (strong,readonly) TestExt *x1;
@property (weak, readonly) TestExt *x2;
@end
@interface TestExt()
- at property (readwrite) TestExt *x1;
+ at property (strong,readwrite) TestExt *x1;
@property (weak, readwrite) TestExt *x2;
@end
Modified: cfe/trunk/test/ARCMT/releases-driver.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/releases-driver.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/releases-driver.m.result (original)
+++ cfe/trunk/test/ARCMT/releases-driver.m.result Fri Jan 20 13:15:02 2012
@@ -20,7 +20,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(void)test:(id)obj;
@end
Modified: cfe/trunk/test/ARCMT/releases.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/releases.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/releases.m.result (original)
+++ cfe/trunk/test/ARCMT/releases.m.result Fri Jan 20 13:15:02 2012
@@ -20,7 +20,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(void)test:(id)obj;
@end
Modified: cfe/trunk/test/ARCMT/remove-dealloc-method.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/remove-dealloc-method.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/remove-dealloc-method.m.result (original)
+++ cfe/trunk/test/ARCMT/remove-dealloc-method.m.result Fri Jan 20 13:15:02 2012
@@ -5,10 +5,10 @@
#define nil ((void*) 0)
@interface Foo
- at property id x;
- at property id y;
- at property id w;
- at property id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
@end
@implementation Foo
Modified: cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result (original)
+++ cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result Fri Jan 20 13:15:02 2012
@@ -3,10 +3,10 @@
// RUN: diff %t %s.result
@interface Foo
- at property id x;
- at property id y;
- at property id w;
- at property id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
@property (strong) id q;
@end
@@ -23,7 +23,7 @@
@end
@interface Bar
- at property Foo *a;
+ at property (strong) Foo *a;
- (void) setA:(Foo*) val;
- (id) a;
@end
Modified: cfe/trunk/test/ARCMT/retains.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/retains.m.result?rev=148559&r1=148558&r2=148559&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/retains.m.result (original)
+++ cfe/trunk/test/ARCMT/retains.m.result Fri Jan 20 13:15:02 2012
@@ -9,7 +9,7 @@
@interface Foo : NSObject {
id bar;
}
- at property id bar;
+ at property (strong) id bar;
-(id)test:(id)obj;
-(id)something;
@end
More information about the cfe-commits
mailing list