[cfe-commits] r144078 - in /cfe/trunk: lib/ARCMigrate/TransProperties.cpp test/ARCMT/GC.m test/ARCMT/GC.m.result

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Nov 7 21:56:12 PST 2011


Author: akirtzidis
Date: Mon Nov  7 23:56:11 2011
New Revision: 144078

URL: http://llvm.org/viewvc/llvm-project?rev=144078&view=rev
Log:
[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.

Modified:
    cfe/trunk/lib/ARCMigrate/TransProperties.cpp
    cfe/trunk/test/ARCMT/GC.m
    cfe/trunk/test/ARCMT/GC.m.result

Modified: cfe/trunk/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransProperties.cpp?rev=144078&r1=144077&r2=144078&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransProperties.cpp Mon Nov  7 23:56:11 2011
@@ -287,8 +287,10 @@
   void maybeAddStrongAttr(PropsTy &props, SourceLocation atLoc) const {
     ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props);
 
-    if (!(propAttrs & ObjCPropertyDecl::OBJC_PR_readonly) ||
-        !hasAllIvarsBacked(props)) {
+    if (!(propAttrs & ObjCPropertyDecl::OBJC_PR_readonly))
+      return; // 'strong' by default.
+
+    if (!hasAllIvarsBacked(props)) {
       addAttribute("strong", atLoc);
     }
 

Modified: cfe/trunk/test/ARCMT/GC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/GC.m?rev=144078&r1=144077&r2=144078&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/GC.m (original)
+++ cfe/trunk/test/ARCMT/GC.m Mon Nov  7 23:56:11 2011
@@ -57,15 +57,17 @@
 
 @interface I4Impl {
   I4Impl *pds2;
+  I4Impl *pds3;
 }
 @property (assign) I4Impl *__weak pw1, *__weak pw2;
 @property (assign) I4Impl *__strong ps;
 @property (assign) I4Impl * pds;
 @property (assign) I4Impl * pds2;
+ at property (readwrite) I4Impl * pds3;
 @end
 
 @implementation I4Impl
- at synthesize pw1, pw2, ps, pds, pds2;
+ at synthesize pw1, pw2, ps, pds, pds2, pds3;
 
 -(void)test1:(CFTypeRef *)cft {
   id x = NSMakeCollectable(cft);

Modified: cfe/trunk/test/ARCMT/GC.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/GC.m.result?rev=144078&r1=144077&r2=144078&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/GC.m.result (original)
+++ cfe/trunk/test/ARCMT/GC.m.result Mon Nov  7 23:56:11 2011
@@ -52,15 +52,17 @@
 
 @interface I4Impl {
   I4Impl *pds2;
+  I4Impl *pds3;
 }
 @property (weak) I4Impl * pw1, * pw2;
 @property  I4Impl * ps;
 @property  I4Impl * pds;
 @property  I4Impl * pds2;
+ at property (readwrite) I4Impl * pds3;
 @end
 
 @implementation I4Impl
- at synthesize pw1, pw2, ps, pds, pds2;
+ at synthesize pw1, pw2, ps, pds, pds2, pds3;
 
 -(void)test1:(CFTypeRef *)cft {
   id x = CFBridgingRelease(cft);





More information about the cfe-commits mailing list