]> granicus.if.org Git - clang/commit
NFC: simplify code in BuildInstanceMessage.
authorManman Ren <manman.ren@gmail.com>
Thu, 7 Apr 2016 19:30:20 +0000 (19:30 +0000)
committerManman Ren <manman.ren@gmail.com>
Thu, 7 Apr 2016 19:30:20 +0000 (19:30 +0000)
commitb85565fd6cd6ccb6079ee4171715523a6653867d
treeba489000763268dc937b6d12016dbc447c7b0515
parent8cca4d7cdf58cac30a9e273dc5d7b5d9c9189bb6
NFC: simplify code in BuildInstanceMessage.

Instead of searching the global pool multiple times: in
LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool,
CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool,
we now collect the method candidates in CollectMultipleMethodsInGlobalPool
only, and other functions will use the collected method set.

This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool,
and SelectBestMethod. It also changes the implementation of
CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is
found, to collect the other kind. This avoids the need to call both
LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265711 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaExprObjC.cpp
lib/Sema/SemaOverload.cpp