[cfe-commits] r153621 - in /cfe/trunk: lib/ARCMigrate/TransProperties.cpp test/ARCMT/assign-prop-with-arc-runtime.m test/ARCMT/assign-prop-with-arc-runtime.m.result
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Mar 28 18:10:32 PDT 2012
Author: akirtzidis
Date: Wed Mar 28 20:10:31 2012
New Revision: 153621
URL: http://llvm.org/viewvc/llvm-project?rev=153621&view=rev
Log:
[arcmt] Fix a bug where a property in a class extension, that did not exist
in the interface, got its attribute rewritten twice, resulting in
'weakweak' or 'strongstrong'.
rdar://11047179
Modified:
cfe/trunk/lib/ARCMigrate/TransProperties.cpp
cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
Modified: cfe/trunk/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransProperties.cpp?rev=153621&r1=153620&r2=153621&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransProperties.cpp Wed Mar 28 20:10:31 2012
@@ -73,13 +73,18 @@
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 @@
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) {
Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m?rev=153621&r1=153620&r2=153621&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m Wed Mar 28 20:10:31 2012
@@ -65,8 +65,9 @@
@interface TestExt()
@property (retain,readwrite) TestExt *x1;
@property (readwrite) TestExt *x2;
+ at property (retain) TestExt *x3;
@end
@implementation TestExt
- at synthesize x1, x2;
+ at synthesize x1, x2, x3;
@end
Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=153621&r1=153620&r2=153621&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result Wed Mar 28 20:10:31 2012
@@ -65,8 +65,9 @@
@interface TestExt()
@property (strong,readwrite) TestExt *x1;
@property (weak, readwrite) TestExt *x2;
+ at property (strong) TestExt *x3;
@end
@implementation TestExt
- at synthesize x1, x2;
+ at synthesize x1, x2, x3;
@end
More information about the cfe-commits
mailing list