Fix ObjCInterfaceDecl::getCategoryMethod() and give it a caller. No behavior change.

llvm-svn: 230928
This commit is contained in:
Nico Weber 2015-03-02 01:12:28 +00:00
parent 43e7f96f64
commit f609839244
2 changed files with 3 additions and 4 deletions

View File

@ -820,8 +820,8 @@ public:
ObjCMethodDecl *getCategoryInstanceMethod(Selector Sel) const; ObjCMethodDecl *getCategoryInstanceMethod(Selector Sel) const;
ObjCMethodDecl *getCategoryClassMethod(Selector Sel) const; ObjCMethodDecl *getCategoryClassMethod(Selector Sel) const;
ObjCMethodDecl *getCategoryMethod(Selector Sel, bool isInstance) const { ObjCMethodDecl *getCategoryMethod(Selector Sel, bool isInstance) const {
return isInstance ? getInstanceMethod(Sel) return isInstance ? getCategoryInstanceMethod(Sel)
: getClassMethod(Sel); : getCategoryClassMethod(Sel);
} }
typedef ObjCProtocolList::iterator protocol_iterator; typedef ObjCProtocolList::iterator protocol_iterator;

View File

@ -616,8 +616,7 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateMethod(
// Look through local category implementations associated with the class. // Look through local category implementations associated with the class.
if (!Method) if (!Method)
Method = Instance ? getCategoryInstanceMethod(Sel) Method = getCategoryMethod(Sel, Instance);
: getCategoryClassMethod(Sel);
// Before we give up, check if the selector is an instance method. // 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 // But only in the root. This matches gcc's behavior and what the