Skip to content

Commit 1f914fb

Browse files
committed
Pull out top-level recording.
1 parent ee6acae commit 1f914fb

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lib/AST/UnqualifiedLookup.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ class UnqualifiedLookupFactory {
239239

240240
bool useASTScopesForExperimentalLookup() const;
241241

242-
void lookupNonlocalsInModuleScopeContext(
243-
DCAndResolvedIsCascadingUse dcAndIsCascadingUse);
242+
void lookupNonlocalsInModuleScopeContext(DeclContext *);
244243

245244
#pragma mark ASTScope-based-lookup declarations
246245

@@ -408,12 +407,7 @@ void UnqualifiedLookupFactory::performUnqualifiedLookup() {
408407
}
409408

410409
void UnqualifiedLookupFactory::lookupNonlocalsInModuleScopeContext(
411-
DCAndResolvedIsCascadingUse dcAndIsCascadingUse) {
412-
DeclContext *const DC = dcAndIsCascadingUse.DC;
413-
const bool isCascadingUse = dcAndIsCascadingUse.isCascadingUse;
414-
415-
recordDependencyOnTopLevelName(DC, Name, isCascadingUse);
416-
410+
DeclContext *DC) {
417411
// TODO: Does the debugger client care about compound names?
418412
if (Name.isSimpleName() && DebugClient &&
419413
DebugClient->lookupOverrides(Name.getBaseName(), DC, Loc,
@@ -581,8 +575,8 @@ void UnqualifiedLookupFactory::lookIntoDeclarationContextForASTScopeLookup(
581575
}
582576
// Lookup in the source file's scope marks the end.
583577
if (isa<SourceFile>(scopeDC)) {
584-
lookupNonlocalsInModuleScopeContext(
585-
DCAndResolvedIsCascadingUse{scopeDC, isCascadingUseResult});
578+
recordDependencyOnTopLevelName(scopeDC, Name, isCascadingUseResult);
579+
lookupNonlocalsInModuleScopeContext(scopeDC);
586580
return;
587581
}
588582

@@ -717,8 +711,9 @@ void UnqualifiedLookupFactory::lookupInModuleScopeContext(
717711
recordCompletionOfAScope();
718712
if (isFirstResultEnough())
719713
return;
720-
lookupNonlocalsInModuleScopeContext(
721-
DCAndUnresolvedIsCascadingUse{dc, isCascadingUse}.resolve(true));
714+
recordDependencyOnTopLevelName(
715+
dc, Name, isCascadingUse.hasValue() ? isCascadingUse.getValue() : true);
716+
lookupNonlocalsInModuleScopeContext(dc);
722717
}
723718

724719
void UnqualifiedLookupFactory::lookupLocalsInPatternBindingInitializer(

0 commit comments

Comments
 (0)