From 342e08fbf1f46a3f7ce49ea7c8cf7e84e757d1c3 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 30 Aug 2011 19:43:21 +0000 Subject: [PATCH] Remove a couple of unnecessary objc method lookups. llvm-svn: 138815 --- clang/lib/Sema/SemaDeclObjC.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index ef978f0730a1..991948f18caa 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/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));