From 0b87883de5b0a9f0a947aa7fc85dba0292837582 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 2 Mar 2015 01:12:28 +0000 Subject: [PATCH] Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230928 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclObjC.h | 4 ++-- lib/AST/DeclObjC.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 97ce132a76..3c24d05dc5 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -820,8 +820,8 @@ public: ObjCMethodDecl *getCategoryInstanceMethod(Selector Sel) const; ObjCMethodDecl *getCategoryClassMethod(Selector Sel) const; ObjCMethodDecl *getCategoryMethod(Selector Sel, bool isInstance) const { - return isInstance ? getInstanceMethod(Sel) - : getClassMethod(Sel); + return isInstance ? getCategoryInstanceMethod(Sel) + : getCategoryClassMethod(Sel); } typedef ObjCProtocolList::iterator protocol_iterator; diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 6e7478474d..77995b5261 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -616,8 +616,7 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateMethod( // Look through local category implementations associated with the class. if (!Method) - Method = Instance ? getCategoryInstanceMethod(Sel) - : getCategoryClassMethod(Sel); + Method = getCategoryMethod(Sel, Instance); // Before we give up, check if the selector is an instance method. // But only in the root. This matches gcc's behavior and what the -- 2.40.0