aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ARCMigrate/TransGCAttrs.cpp25
-rw-r--r--test/ARCMT/GC-no-arc-runtime.m4
-rw-r--r--test/ARCMT/GC-no-arc-runtime.m.result4
-rw-r--r--test/ARCMT/GC-no-finalize-removal.m4
-rw-r--r--test/ARCMT/GC-no-finalize-removal.m.result4
-rw-r--r--test/ARCMT/GC.m9
-rw-r--r--test/ARCMT/GC.m.result9
7 files changed, 16 insertions, 43 deletions
diff --git a/lib/ARCMigrate/TransGCAttrs.cpp b/lib/ARCMigrate/TransGCAttrs.cpp
index fa62b36208..de710abb5d 100644
--- a/lib/ARCMigrate/TransGCAttrs.cpp
+++ b/lib/ARCMigrate/TransGCAttrs.cpp
@@ -183,30 +183,6 @@ public:
} // anonymous namespace
-static void clearRedundantStrongs(MigrationContext &MigrateCtx) {
- TransformActions &TA = MigrateCtx.Pass.TA;
-
- for (unsigned i = 0, e = MigrateCtx.GCAttrs.size(); i != e; ++i) {
- MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs[i];
- if (Attr.Kind == MigrationContext::GCAttrOccurrence::Strong &&
- Attr.FullyMigratable && Attr.Dcl) {
- TypeSourceInfo *TInfo = 0;
- if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(Attr.Dcl))
- TInfo = DD->getTypeSourceInfo();
- else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(Attr.Dcl))
- TInfo = PD->getTypeSourceInfo();
- if (!TInfo)
- continue;
-
- if (TInfo->getType().getObjCLifetime() == Qualifiers::OCL_Strong) {
- Transaction Trans(TA);
- TA.remove(Attr.Loc);
- MigrateCtx.RemovedAttrSet.insert(Attr.Loc.getRawEncoding());
- }
- }
- }
-}
-
static void errorForGCAttrsOnNonObjC(MigrationContext &MigrateCtx) {
TransformActions &TA = MigrateCtx.Pass.TA;
@@ -354,7 +330,6 @@ void GCAttrsTraverser::traverseTU(MigrationContext &MigrateCtx) {
GCAttrsCollector(MigrateCtx, AllProps).TraverseDecl(
MigrateCtx.Pass.Ctx.getTranslationUnitDecl());
- clearRedundantStrongs(MigrateCtx);
errorForGCAttrsOnNonObjC(MigrateCtx);
checkAllProps(MigrateCtx, AllProps);
checkWeakGCAttrs(MigrateCtx);
diff --git a/test/ARCMT/GC-no-arc-runtime.m b/test/ARCMT/GC-no-arc-runtime.m
index ab9d6a4ae5..f0699927ed 100644
--- a/test/ARCMT/GC-no-arc-runtime.m
+++ b/test/ARCMT/GC-no-arc-runtime.m
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = NSMakeCollectable(cft);
}
-@interface I1 {
- __strong I1 *myivar;
-}
+@interface I1
@end
@implementation I1
diff --git a/test/ARCMT/GC-no-arc-runtime.m.result b/test/ARCMT/GC-no-arc-runtime.m.result
index 983a5b1742..f55ca38070 100644
--- a/test/ARCMT/GC-no-arc-runtime.m.result
+++ b/test/ARCMT/GC-no-arc-runtime.m.result
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = CFBridgingRelease(cft);
}
-@interface I1 {
- I1 *myivar;
-}
+@interface I1
@end
@implementation I1
diff --git a/test/ARCMT/GC-no-finalize-removal.m b/test/ARCMT/GC-no-finalize-removal.m
index d9739376f2..14e8602446 100644
--- a/test/ARCMT/GC-no-finalize-removal.m
+++ b/test/ARCMT/GC-no-finalize-removal.m
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = NSMakeCollectable(cft);
}
-@interface I1 {
- __strong I1 *myivar;
-}
+@interface I1
@end
@implementation I1
diff --git a/test/ARCMT/GC-no-finalize-removal.m.result b/test/ARCMT/GC-no-finalize-removal.m.result
index 38aabc32ae..ea14873ec3 100644
--- a/test/ARCMT/GC-no-finalize-removal.m.result
+++ b/test/ARCMT/GC-no-finalize-removal.m.result
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = CFBridgingRelease(cft);
}
-@interface I1 {
- I1 *myivar;
-}
+@interface I1
@end
@implementation I1
diff --git a/test/ARCMT/GC.m b/test/ARCMT/GC.m
index f241e43008..eebbaf6854 100644
--- a/test/ARCMT/GC.m
+++ b/test/ARCMT/GC.m
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = NSMakeCollectable(cft);
}
-@interface I1 {
- __strong I1 *myivar;
-}
+@interface I1
@end
@implementation I1
@@ -90,3 +88,8 @@ __attribute__((objc_arc_weak_reference_unavailable))
@implementation rdar10532449
@synthesize assign_prop, strong_readonly_prop, weak_prop;
@end
+
+void test2(id p, __strong I1 *ap[]) {
+ for (__strong I1 *specRule in p) {
+ }
+}
diff --git a/test/ARCMT/GC.m.result b/test/ARCMT/GC.m.result
index f9e954af5a..c2c523f77e 100644
--- a/test/ARCMT/GC.m.result
+++ b/test/ARCMT/GC.m.result
@@ -12,9 +12,7 @@ void test1(CFTypeRef *cft) {
id x = CFBridgingRelease(cft);
}
-@interface I1 {
- I1 *myivar;
-}
+@interface I1
@end
@implementation I1
@@ -85,3 +83,8 @@ __attribute__((objc_arc_weak_reference_unavailable))
@implementation rdar10532449
@synthesize assign_prop, strong_readonly_prop, weak_prop;
@end
+
+void test2(id p, __strong I1 *ap[]) {
+ for (__strong I1 *specRule in p) {
+ }
+}