From: Argyrios Kyrtzidis Date: Tue, 30 Aug 2011 19:43:21 +0000 (+0000) Subject: Remove a couple of unnecessary objc method lookups. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2334f3aeda318f68e763379afa5ac7a91b90caa7;p=clang Remove a couple of unnecessary objc method lookups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138815 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index ef978f0730..991948f18c 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1485,11 +1485,10 @@ void Sema::MatchAllMethodDeclarations(const llvm::DenseSet &InsMap, continue; } else { ObjCMethodDecl *ImpMethodDecl = - IMPDecl->getInstanceMethod((*I)->getSelector()); - ObjCMethodDecl *MethodDecl = - CDecl->getInstanceMethod((*I)->getSelector()); - assert(MethodDecl && - "MethodDecl is null in ImplMethodsVsClassMethods"); + IMPDecl->getInstanceMethod((*I)->getSelector()); + assert(CDecl->getInstanceMethod((*I)->getSelector()) && + "Expected to find the method through lookup as well"); + ObjCMethodDecl *MethodDecl = *I; // ImpMethodDecl may be null as in a @dynamic property. if (ImpMethodDecl) { if (!WarnExactMatch) @@ -1516,8 +1515,9 @@ void Sema::MatchAllMethodDeclarations(const llvm::DenseSet &InsMap, } else { ObjCMethodDecl *ImpMethodDecl = IMPDecl->getClassMethod((*I)->getSelector()); - ObjCMethodDecl *MethodDecl = - CDecl->getClassMethod((*I)->getSelector()); + assert(CDecl->getClassMethod((*I)->getSelector()) && + "Expected to find the method through lookup as well"); + ObjCMethodDecl *MethodDecl = *I; if (!WarnExactMatch) WarnConflictingTypedMethods(ImpMethodDecl, MethodDecl, isa(CDecl));