r197448 - ObjectiveC migrator. Fixes a bug when protocol
Fariborz Jahanian
fjahanian at apple.com
Mon Dec 16 17:01:33 PST 2013
Author: fjahanian
Date: Mon Dec 16 19:01:33 2013
New Revision: 197448
URL: http://llvm.org/viewvc/llvm-project?rev=197448&view=rev
Log:
ObjectiveC migrator. Fixes a bug when protocol
conformance is inferred. // rdar://15515206
Modified:
cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m
cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m.result
Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=197448&r1=197447&r2=197448&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Mon Dec 16 19:01:33 2013
@@ -756,6 +756,8 @@ void ObjCMigrateASTConsumer::migrateProt
if (!DropIt)
MinimalConformingProtocols.push_back(TargetPDecl);
}
+ if (MinimalConformingProtocols.empty())
+ return;
edit::Commit commit(*Editor);
rewriteToObjCInterfaceDecl(IDecl, MinimalConformingProtocols,
*NSAPIObj, commit);
@@ -1765,7 +1767,7 @@ void ObjCMigrateASTConsumer::HandleTrans
migrateObjCInterfaceDecl(Ctx, CatDecl);
}
else if (ObjCProtocolDecl *PDecl = dyn_cast<ObjCProtocolDecl>(*D))
- ObjCProtocolDecls.insert(PDecl);
+ ObjCProtocolDecls.insert(PDecl->getCanonicalDecl());
else if (const ObjCImplementationDecl *ImpDecl =
dyn_cast<ObjCImplementationDecl>(*D)) {
if ((ASTMigrateActions & FrontendOptions::ObjCMT_ProtocolConformance) &&
Modified: cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m?rev=197448&r1=197447&r2=197448&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m (original)
+++ cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m Mon Dec 16 19:01:33 2013
@@ -112,3 +112,19 @@
@implementation Test7
@end
+// rdar://15515206
+ at interface BTLEBrowser
+ at end
+
+ at protocol CBCentralManagerDelegate;
+
+ at protocol CBCentralManagerDelegate
+- (id) Meth1: (double) arg;
+ at end
+
+ at interface BTLEBrowser() <CBCentralManagerDelegate>
+ at end
+
+ at implementation BTLEBrowser
+- (id) Meth15515206: (double) arg { return 0; }
+ at end
Modified: cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m.result?rev=197448&r1=197447&r2=197448&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m.result (original)
+++ cfe/trunk/test/ARCMT/objcmt-protocol-conformance.m.result Mon Dec 16 19:01:33 2013
@@ -112,3 +112,19 @@
@implementation Test7
@end
+// rdar://15515206
+ at interface BTLEBrowser
+ at end
+
+ at protocol CBCentralManagerDelegate;
+
+ at protocol CBCentralManagerDelegate
+- (id) Meth1: (double) arg;
+ at end
+
+ at interface BTLEBrowser() <CBCentralManagerDelegate>
+ at end
+
+ at implementation BTLEBrowser
+- (id) Meth15515206: (double) arg { return 0; }
+ at end
More information about the cfe-commits
mailing list