From 968860904a65619899c9f38673c8236a81240d93 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 13 Jul 2011 19:47:57 +0000 Subject: [PATCH] [arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizing it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135067 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/TransProperties.cpp | 2 +- test/ARCMT/assign-prop-with-arc-runtime.m | 5 +++-- test/ARCMT/assign-prop-with-arc-runtime.m.result | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp index 3a334f9432..872c95e1a4 100644 --- a/lib/ARCMigrate/TransProperties.cpp +++ b/lib/ARCMigrate/TransProperties.cpp @@ -307,7 +307,7 @@ private: bool hasNoBackingIvars(PropsTy &props) const { for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) - if (isUserDeclared(I->IvarD)) + if (I->IvarD) return false; return true; diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m b/test/ARCMT/assign-prop-with-arc-runtime.m index 32d30e53e4..4e4ae774a2 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m +++ b/test/ARCMT/assign-prop-with-arc-runtime.m @@ -30,10 +30,11 @@ typedef _NSCachedAttributedString *BadClassForWeak; @property () NSObject *not_safe2; @property Forw *not_safe3; -@property (assign) Foo *no_back_ivar; +@property (assign) Foo *no_user_ivar1; +@property (readonly) Foo *no_user_ivar2; @end @implementation Foo @synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3; -@synthesize no_back_ivar; +@synthesize no_user_ivar1, no_user_ivar2; @end diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m.result b/test/ARCMT/assign-prop-with-arc-runtime.m.result index 3a6c349405..eb34c168e4 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m.result +++ b/test/ARCMT/assign-prop-with-arc-runtime.m.result @@ -30,10 +30,11 @@ typedef _NSCachedAttributedString *BadClassForWeak; @property (unsafe_unretained) NSObject *not_safe2; @property (unsafe_unretained) Forw *not_safe3; -@property (weak) Foo *no_back_ivar; +@property (weak) Foo *no_user_ivar1; +@property (weak, readonly) Foo *no_user_ivar2; @end @implementation Foo @synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3; -@synthesize no_back_ivar; +@synthesize no_user_ivar1, no_user_ivar2; @end -- 2.40.0