aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-08 05:56:11 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-08 05:56:11 +0000
commitae7c25dab5ed7c8fc05462c8daf48e7d0945d364 (patch)
tree6ce792ea56965cdd45efafe39de9e863df942c1e
parent263d66718365aadc621c3feb9badedf46d787e0e (diff)
[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144078 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/ARCMigrate/TransProperties.cpp6
-rw-r--r--test/ARCMT/GC.m4
-rw-r--r--test/ARCMT/GC.m.result4
3 files changed, 10 insertions, 4 deletions
diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp
index 050512fbbe..7e890ef608 100644
--- a/lib/ARCMigrate/TransProperties.cpp
+++ b/lib/ARCMigrate/TransProperties.cpp
@@ -287,8 +287,10 @@ private:
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);
}
diff --git a/test/ARCMT/GC.m b/test/ARCMT/GC.m
index 28846792ad..d657387a03 100644
--- a/test/ARCMT/GC.m
+++ b/test/ARCMT/GC.m
@@ -57,15 +57,17 @@ __attribute__((objc_arc_weak_reference_unavailable))
@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;
+@property (readwrite) I4Impl * pds3;
@end
@implementation I4Impl
-@synthesize pw1, pw2, ps, pds, pds2;
+@synthesize pw1, pw2, ps, pds, pds2, pds3;
-(void)test1:(CFTypeRef *)cft {
id x = NSMakeCollectable(cft);
diff --git a/test/ARCMT/GC.m.result b/test/ARCMT/GC.m.result
index aaa5ee5b56..96437b8973 100644
--- a/test/ARCMT/GC.m.result
+++ b/test/ARCMT/GC.m.result
@@ -52,15 +52,17 @@ __attribute__((objc_arc_weak_reference_unavailable))
@interface I4Impl {
I4Impl *pds2;
+ I4Impl *pds3;
}
@property (weak) I4Impl * pw1, * pw2;
@property I4Impl * ps;
@property I4Impl * pds;
@property I4Impl * pds2;
+@property (readwrite) I4Impl * pds3;
@end
@implementation I4Impl
-@synthesize pw1, pw2, ps, pds, pds2;
+@synthesize pw1, pw2, ps, pds, pds2, pds3;
-(void)test1:(CFTypeRef *)cft {
id x = CFBridgingRelease(cft);