r215581 - Objective-C. Minor refactoring of my last patch.
Fariborz Jahanian
fjahanian at apple.com
Wed Aug 13 14:24:14 PDT 2014
Author: fjahanian
Date: Wed Aug 13 16:24:14 2014
New Revision: 215581
URL: http://llvm.org/viewvc/llvm-project?rev=215581&view=rev
Log:
Objective-C. Minor refactoring of my last patch.
// rdar://16808765
Modified:
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Sema/SemaExprObjC.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=215581&r1=215580&r2=215581&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Aug 13 16:24:14 2014
@@ -2894,7 +2894,7 @@ private:
/// \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.
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=215581&r1=215580&r2=215581&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Wed Aug 13 16:24:14 2014
@@ -2418,13 +2418,10 @@ ExprResult Sema::BuildInstanceMessage(Ex
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.
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=215581&r1=215580&r2=215581&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Aug 13 16:24:14 2014
@@ -5678,7 +5678,11 @@ Sema::AddOverloadCandidate(FunctionDecl
}
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];
More information about the cfe-commits
mailing list