]> granicus.if.org Git - clang/commitdiff
[arcmt] Now that readonly properties are strong-by-default, do not add redundant...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 8 Nov 2011 22:10:58 +0000 (22:10 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 8 Nov 2011 22:10:58 +0000 (22:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144136 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/TransProperties.cpp
test/ARCMT/GC.m
test/ARCMT/GC.m.result
test/ARCMT/assign-prop-with-arc-runtime.m.result

index 7e890ef608ffc6cdb6cbd6718256c07d126da963..f9c02061343ffb04cb3535e9389042af900505fc 100644 (file)
@@ -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);
   }
index d657387a03ea239cd8beecd1e6d991d7c24303f2..35e9bcf9ce18ae63015fd5e8b92acb26a46d2217 100644 (file)
@@ -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);
index 96437b8973bd768e0a32cdec53a99a021cdab6d0..540c2a2932f725670375c853fccfd1f16aba956a 100644 (file)
@@ -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);
index 2c67f18180a8b5280778dfaa0b6e0fb13560f129..7cb7e1722ba7083c6303337626ea82eae794ca14 100644 (file)
@@ -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;