diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-01-10 19:27:21 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-01-10 19:27:21 +0000 |
commit | 26cb6d90b8dd184dbbe6ace171320871aac5f94b (patch) | |
tree | 9c2a15be05be52b931587e15cfae202e66bd95be /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | c2e9d759f29602021daa26453452928c81adffbb (diff) | |
download | bcm5719-llvm-26cb6d90b8dd184dbbe6ace171320871aac5f94b.tar.gz bcm5719-llvm-26cb6d90b8dd184dbbe6ace171320871aac5f94b.zip |
ObjectiveC. Remove warning on mismatched methods
which may belong to unrelated classes. It was
primarily intended for miuse of @selector expression.
But warning is too noisy and will be issued when
an actual @selector is used. // rdar://15740134
llvm-svn: 198952
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 5bd0ac51a7a..34d1965fa58 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -2469,51 +2469,6 @@ Sema::SelectorsForTypoCorrection(Selector Sel, return (SelectedMethods.size() == 1) ? SelectedMethods[0] : NULL; } -static void -HelperToDiagnoseMismatchedMethodsInGlobalPool(Sema &S, - ObjCMethodList &MethList) { - ObjCMethodList *M = &MethList; - ObjCMethodDecl *TargetMethod = M->Method; - while (TargetMethod && - isa<ObjCImplDecl>(TargetMethod->getDeclContext())) { - M = M->getNext(); - TargetMethod = M ? M->Method : 0; - } - if (!TargetMethod) - return; - bool FirstTime = true; - for (M = M->getNext(); M; M=M->getNext()) { - ObjCMethodDecl *MatchingMethodDecl = M->Method; - if (isa<ObjCImplDecl>(MatchingMethodDecl->getDeclContext())) - continue; - if (!S.MatchTwoMethodDeclarations(TargetMethod, - MatchingMethodDecl, Sema::MMS_loose)) { - if (FirstTime) { - FirstTime = false; - S.Diag(TargetMethod->getLocation(), diag::warning_multiple_selectors) - << TargetMethod->getSelector(); - } - S.Diag(MatchingMethodDecl->getLocation(), diag::note_also_found); - } - } -} - -void Sema::DiagnoseMismatchedMethodsInGlobalPool() { - unsigned DIAG = diag::warning_multiple_selectors; - if (Diags.getDiagnosticLevel(DIAG, SourceLocation()) - == DiagnosticsEngine::Ignored) - return; - for (GlobalMethodPool::iterator b = MethodPool.begin(), - e = MethodPool.end(); b != e; b++) { - // first, instance methods - ObjCMethodList &InstMethList = b->second.first; - HelperToDiagnoseMismatchedMethodsInGlobalPool(*this, InstMethList); - // second, class methods - ObjCMethodList &ClsMethList = b->second.second; - HelperToDiagnoseMismatchedMethodsInGlobalPool(*this, ClsMethList); - } -} - /// DiagnoseDuplicateIvars - /// Check for duplicate ivars in the entire class at the start of /// \@implementation. This becomes necesssary because class extension can @@ -3470,8 +3425,6 @@ void Sema::DiagnoseUseOfUnimplementedSelectors() { ReferencedSelectors[Sels[I].first] = Sels[I].second; } - DiagnoseMismatchedMethodsInGlobalPool(); - // Warning will be issued only when selector table is // generated (which means there is at lease one implementation // in the TU). This is to match gcc's behavior. |