diff options
-rw-r--r-- | lib/ARCMigrate/TransProperties.cpp | 11 | ||||
-rw-r--r-- | test/ARCMT/assign-prop-with-arc-runtime.m | 3 | ||||
-rw-r--r-- | test/ARCMT/assign-prop-with-arc-runtime.m.result | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/lib/ARCMigrate/TransProperties.cpp b/lib/ARCMigrate/TransProperties.cpp index 7eb2a9bfc7..cc85fe25cc 100644 --- a/lib/ARCMigrate/TransProperties.cpp +++ b/lib/ARCMigrate/TransProperties.cpp @@ -73,13 +73,18 @@ public: explicit PropertiesRewriter(MigrationContext &MigrateCtx) : MigrateCtx(MigrateCtx), Pass(MigrateCtx.Pass) { } - static void collectProperties(ObjCContainerDecl *D, AtPropDeclsTy &AtProps) { + static void collectProperties(ObjCContainerDecl *D, AtPropDeclsTy &AtProps, + AtPropDeclsTy *PrevAtProps = 0) { for (ObjCInterfaceDecl::prop_iterator propI = D->prop_begin(), propE = D->prop_end(); propI != propE; ++propI) { if (propI->getAtLoc().isInvalid()) continue; - PropsTy &props = AtProps[propI->getAtLoc().getRawEncoding()]; + unsigned RawLoc = propI->getAtLoc().getRawEncoding(); + if (PrevAtProps) + if (PrevAtProps->find(RawLoc) != PrevAtProps->end()) + continue; + PropsTy &props = AtProps[RawLoc]; props.push_back(*propI); } } @@ -139,7 +144,7 @@ public: for (ObjCCategoryDecl *Cat = iface->getCategoryList(); Cat; Cat = Cat->getNextClassCategory()) if (Cat->IsClassExtension()) - collectProperties(Cat, AtExtProps); + collectProperties(Cat, AtExtProps, &AtProps); for (AtPropDeclsTy::iterator I = AtExtProps.begin(), E = AtExtProps.end(); I != E; ++I) { diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m b/test/ARCMT/assign-prop-with-arc-runtime.m index 0221afac84..c357eeb171 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m +++ b/test/ARCMT/assign-prop-with-arc-runtime.m @@ -65,8 +65,9 @@ typedef _NSCachedAttributedString *BadClassForWeak; @interface TestExt() @property (retain,readwrite) TestExt *x1; @property (readwrite) TestExt *x2; +@property (retain) TestExt *x3; @end @implementation TestExt -@synthesize x1, x2; +@synthesize x1, x2, x3; @end diff --git a/test/ARCMT/assign-prop-with-arc-runtime.m.result b/test/ARCMT/assign-prop-with-arc-runtime.m.result index 30a9caa844..a255a36f24 100644 --- a/test/ARCMT/assign-prop-with-arc-runtime.m.result +++ b/test/ARCMT/assign-prop-with-arc-runtime.m.result @@ -65,8 +65,9 @@ typedef _NSCachedAttributedString *BadClassForWeak; @interface TestExt() @property (strong,readwrite) TestExt *x1; @property (weak, readwrite) TestExt *x2; +@property (strong) TestExt *x3; @end @implementation TestExt -@synthesize x1, x2; +@synthesize x1, x2, x3; @end |