diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-12-17 01:01:33 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-12-17 01:01:33 +0000 |
| commit | 769c04ea359e555bd60ae50763427d645d0a396e (patch) | |
| tree | 3d166caf9c4f1564d22c519e5f83be47b7314f7d /clang | |
| parent | 0caf4fef47e27f8ea13bcaabb9a9969b3234c298 (diff) | |
| download | bcm5719-llvm-769c04ea359e555bd60ae50763427d645d0a396e.tar.gz bcm5719-llvm-769c04ea359e555bd60ae50763427d645d0a396e.zip | |
ObjectiveC migrator. Fixes a bug when protocol
conformance is inferred. // rdar://15515206
llvm-svn: 197448
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 4 | ||||
| -rw-r--r-- | clang/test/ARCMT/objcmt-protocol-conformance.m | 16 | ||||
| -rw-r--r-- | clang/test/ARCMT/objcmt-protocol-conformance.m.result | 16 |
3 files changed, 35 insertions, 1 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index cd0d01957e4..e12df0582f6 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -756,6 +756,8 @@ void ObjCMigrateASTConsumer::migrateProtocolConformance(ASTContext &Ctx, 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::HandleTranslationUnit(ASTContext &Ctx) { 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) && diff --git a/clang/test/ARCMT/objcmt-protocol-conformance.m b/clang/test/ARCMT/objcmt-protocol-conformance.m index 7bc7d938177..f4c8f5112a6 100644 --- a/clang/test/ARCMT/objcmt-protocol-conformance.m +++ b/clang/test/ARCMT/objcmt-protocol-conformance.m @@ -112,3 +112,19 @@ @implementation Test7 @end +// rdar://15515206 +@interface BTLEBrowser +@end + +@protocol CBCentralManagerDelegate; + +@protocol CBCentralManagerDelegate +- (id) Meth1: (double) arg; +@end + +@interface BTLEBrowser() <CBCentralManagerDelegate> +@end + +@implementation BTLEBrowser +- (id) Meth15515206: (double) arg { return 0; } +@end diff --git a/clang/test/ARCMT/objcmt-protocol-conformance.m.result b/clang/test/ARCMT/objcmt-protocol-conformance.m.result index dc0874c88f2..0322ab81d6a 100644 --- a/clang/test/ARCMT/objcmt-protocol-conformance.m.result +++ b/clang/test/ARCMT/objcmt-protocol-conformance.m.result @@ -112,3 +112,19 @@ @implementation Test7 @end +// rdar://15515206 +@interface BTLEBrowser +@end + +@protocol CBCentralManagerDelegate; + +@protocol CBCentralManagerDelegate +- (id) Meth1: (double) arg; +@end + +@interface BTLEBrowser() <CBCentralManagerDelegate> +@end + +@implementation BTLEBrowser +- (id) Meth15515206: (double) arg { return 0; } +@end |

