@@ -332,8 +332,7 @@ class UnqualifiedLookupFactory {
332
332
// / Return true if lookup is done
333
333
bool addLocalVariableResults (DeclContext *dc);
334
334
335
- // / Return true if finished with lookup
336
- bool setAsideUnavailableResults (size_t firstPossiblyUnavailableResult);
335
+ void setAsideUnavailableResults (size_t firstPossiblyUnavailableResult);
337
336
338
337
void recordDependencyOnTopLevelName (DeclContext *topLevelContext,
339
338
DeclName name, bool isCascadingUse);
@@ -692,10 +691,11 @@ void UnqualifiedLookupFactory::finishLookingInContext(
692
691
placesToSearch.getValue ().addToResults (
693
692
Name, isCascadingUse.getValue (), baseNLOptions,
694
693
lookupContextForThisContext, Results);
695
- if (setAsideUnavailableResults (firstPossiblyUnavailableResult))
694
+ setAsideUnavailableResults (firstPossiblyUnavailableResult);
695
+ recordCompletionOfAScope ();
696
+ if (isFirstResultEnough ())
696
697
return ;
697
698
}
698
-
699
699
// Recurse into the next context.
700
700
lookupStartingWith (DCAndUnresolvedIsCascadingUse{
701
701
lookupContextForThisContext->getParentForLookup (), isCascadingUse});
@@ -976,12 +976,12 @@ void UnqualifiedLookupFactory::PlacesToSearch::addToResults(
976
976
results.push_back (LookupResultEntry (whereValueIsMember (Result), Result));
977
977
}
978
978
979
- bool UnqualifiedLookupFactory::setAsideUnavailableResults (
979
+ void UnqualifiedLookupFactory::setAsideUnavailableResults (
980
980
const size_t firstPossiblyUnavailableResult) {
981
981
// An optimization:
982
982
assert (Results.size () >= firstPossiblyUnavailableResult);
983
983
if (Results.size () == firstPossiblyUnavailableResult)
984
- return false ;
984
+ return ;
985
985
// Predicate that determines whether a lookup result should
986
986
// be unavailable except as a last-ditch effort.
987
987
auto unavailableLookupResult = [&](const LookupResultEntry &result) {
@@ -995,12 +995,9 @@ bool UnqualifiedLookupFactory::setAsideUnavailableResults(
995
995
if (std::all_of (begin, Results.end (), unavailableLookupResult)) {
996
996
UnavailableInnerResults.append (begin, Results.end ());
997
997
Results.erase (begin, Results.end ());
998
- return false ;
998
+ return ;
999
999
}
1000
1000
filterForDiscriminator (Results, DebugClient);
1001
-
1002
- recordCompletionOfAScope ();
1003
- return isFirstResultEnough ();
1004
1001
}
1005
1002
1006
1003
void UnqualifiedLookupFactory::recordDependencyOnTopLevelName (
0 commit comments