From af9b5e9f3eede62347835d8dedd44df86cbcc308 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 8 Nov 2011 22:10:58 +0000 Subject: [PATCH] [arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144136 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/TransProperties.cpp | 2 +- test/ARCMT/GC.m | 3 ++- test/ARCMT/GC.m.result | 3 ++- test/ARCMT/assign-prop-with-arc-runtime.m.result | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp index 7e890ef608..f9c0206134 100644 --- a/lib/ARCMigrate/TransProperties.cpp +++ b/lib/ARCMigrate/TransProperties.cpp @@ -218,7 +218,7 @@ private: if (HasIvarAssignedAPlusOneObject || (Pass.isGCMigration() && !hasGCWeak(props, atLoc))) - return doPropAction(PropAction_MaybeAddStrong, props, atLoc); + return; // 'strong' by default. return doPropAction(PropAction_MaybeAddWeakOrUnsafe, props, atLoc); } diff --git a/test/ARCMT/GC.m b/test/ARCMT/GC.m index d657387a03..35e9bcf9ce 100644 --- a/test/ARCMT/GC.m +++ b/test/ARCMT/GC.m @@ -64,10 +64,11 @@ __attribute__((objc_arc_weak_reference_unavailable)) @property (assign) I4Impl * pds; @property (assign) I4Impl * pds2; @property (readwrite) I4Impl * pds3; +@property (readonly) I4Impl * pds4; @end @implementation I4Impl -@synthesize pw1, pw2, ps, pds, pds2, pds3; +@synthesize pw1, pw2, ps, pds, pds2, pds3, pds4; -(void)test1:(CFTypeRef *)cft { id x = NSMakeCollectable(cft); diff --git a/test/ARCMT/GC.m.result b/test/ARCMT/GC.m.result index 96437b8973..540c2a2932 100644 --- a/test/ARCMT/GC.m.result +++ b/test/ARCMT/GC.m.result @@ -59,10 +59,11 @@ __attribute__((objc_arc_weak_reference_unavailable)) @property I4Impl * pds; @property I4Impl * pds2; @property (readwrite) I4Impl * pds3; +@property (readonly) I4Impl * pds4; @end @implementation I4Impl -@synthesize pw1, pw2, ps, pds, pds2, pds3; +@synthesize pw1, pw2, ps, pds, pds2, pds3, pds4; -(void)test1:(CFTypeRef *)cft { id x = CFBridgingRelease(cft); diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m.result b/test/ARCMT/assign-prop-with-arc-runtime.m.result index 2c67f18180..7cb7e1722b 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m.result +++ b/test/ARCMT/assign-prop-with-arc-runtime.m.result @@ -32,8 +32,8 @@ typedef _NSCachedAttributedString *BadClassForWeak; @property (unsafe_unretained) NSObject *not_safe2; @property (unsafe_unretained) Forw *not_safe3; @property (readonly) Foo *assign_plus1; -@property (strong, readonly) Foo *assign_plus2; -@property (strong, readonly) Foo *assign_plus3; +@property (readonly) Foo *assign_plus2; +@property (readonly) Foo *assign_plus3; @property (weak) Foo *no_user_ivar1; @property (weak, readonly) Foo *no_user_ivar2; -- 2.40.0