From b96505ea68abd42ea279430de63301c6c76d4803 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Thu, 7 Apr 2016 19:32:24 +0000 Subject: [ObjC kindof] Use type bound to filter out the candidate methods. rdar://21306753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265712 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExprObjC.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Sema/SemaExprObjC.cpp') diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 7a51e612af..56161c7a4d 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2618,16 +2618,15 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, if (!Method) { // Handle messages to id and __kindof types (where we use the // global method pool). - // FIXME: The type bound is currently ignored by lookup in the - // global pool. const ObjCObjectType *typeBound = nullptr; bool receiverIsIdLike = ReceiverType->isObjCIdOrObjectKindOfType(Context, typeBound); if (receiverIsIdLike || ReceiverType->isBlockPointerType() || (Receiver && Context.isObjCNSObjectType(Receiver->getType()))) { SmallVector Methods; + // If we have a type bound, further filter the methods. CollectMultipleMethodsInGlobalPool(Sel, Methods, true/*InstanceFirst*/, - true/*CheckTheOther*/); + true/*CheckTheOther*/, typeBound); if (!Methods.empty()) { // We chose the first method as the initial condidate, then try to // select a better one. -- cgit v1.2.1