diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-08 05:56:11 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-08 05:56:11 +0000 |
commit | dbe077a89da99afcb551ee0722e78f3dfcacf0b0 (patch) | |
tree | 96d5236dae24fe7f36d67e8784ce09f68986c853 /clang | |
parent | 3befb8cd8af2031657fb4f3bea495588b6f9cb4e (diff) | |
download | bcm5719-llvm-dbe077a89da99afcb551ee0722e78f3dfcacf0b0.tar.gz bcm5719-llvm-dbe077a89da99afcb551ee0722e78f3dfcacf0b0.zip |
[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.
llvm-svn: 144078
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/ARCMigrate/TransProperties.cpp | 6 | ||||
-rw-r--r-- | clang/test/ARCMT/GC.m | 4 | ||||
-rw-r--r-- | clang/test/ARCMT/GC.m.result | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/ARCMigrate/TransProperties.cpp b/clang/lib/ARCMigrate/TransProperties.cpp index 050512fbbec..7e890ef608f 100644 --- a/clang/lib/ARCMigrate/TransProperties.cpp +++ b/clang/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/clang/test/ARCMT/GC.m b/clang/test/ARCMT/GC.m index 28846792ad4..d657387a03e 100644 --- a/clang/test/ARCMT/GC.m +++ b/clang/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/clang/test/ARCMT/GC.m.result b/clang/test/ARCMT/GC.m.result index aaa5ee5b569..96437b8973b 100644 --- a/clang/test/ARCMT/GC.m.result +++ b/clang/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); |