diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-13 21:24:14 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-13 21:24:14 +0000 |
| commit | 0ded42451d8d439a3ec774e34acfc6e6c6113cca (patch) | |
| tree | a634a04ce441a8174fe22b404170dad61264675a /clang/lib | |
| parent | caa8bfd13b8e0477d5c5256170408ac24cd2e1e5 (diff) | |
| download | bcm5719-llvm-0ded42451d8d439a3ec774e34acfc6e6c6113cca.tar.gz bcm5719-llvm-0ded42451d8d439a3ec774e34acfc6e6c6113cca.zip | |
Objective-C. Minor refactoring of my last patch.
// rdar://16808765
llvm-svn: 215581
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 6cc1658934d..80ce9baee75 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -2418,13 +2418,10 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, 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. diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 660d60da2a3..09469cea772 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -5678,7 +5678,11 @@ Sema::AddOverloadCandidate(FunctionDecl *Function, } 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]; |

