/// \brief - Returns a selector which best matches given argument list or
/// nullptr if none could be found
ObjCMethodDecl *SelectBestMethod(Selector Sel, MultiExprArg Args,
- SmallVectorImpl<ObjCMethodDecl*>& Methods);
+ bool IsInstance);
/// \brief Record the typo correction failure and return an empty correction.
Method = LookupFactoryMethodInGlobalPool(Sel,
SourceRange(LBracLoc,RBracLoc),
receiverIsId);
- if (Method) {
- SmallVector<ObjCMethodDecl*, 4> Methods;
- if (CollectMultipleMethodsInGlobalPool(Sel, Methods,
- Method->isInstanceMethod()))
- if (ObjCMethodDecl *BestMethod = SelectBestMethod(Sel, ArgsIn, Methods))
- Method = BestMethod;
- }
+ if (Method)
+ if (ObjCMethodDecl *BestMethod =
+ SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
+ Method = BestMethod;
} else if (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType()) {
// Handle messages to Class.
}
ObjCMethodDecl *Sema::SelectBestMethod(Selector Sel, MultiExprArg Args,
- SmallVectorImpl<ObjCMethodDecl*>& Methods) {
+ bool IsInstance) {
+ SmallVector<ObjCMethodDecl*, 4> Methods;
+ if (!CollectMultipleMethodsInGlobalPool(Sel, Methods, IsInstance))
+ return nullptr;
+
for (unsigned b = 0, e = Methods.size(); b < e; b++) {
bool Match = true;
ObjCMethodDecl *Method = Methods[b];