Skip to content

Commit 8f67ef6

Browse files
author
David Ungar
committed
Add comment and renamed lookUpTopLevelNames…
1 parent d5983da commit 8f67ef6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/AST/UnqualifiedLookup.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class UnqualifiedLookupFactory {
226226

227227
bool useASTScopesForExperimentalLookup() const;
228228

229-
void lookupNonlocalsInModuleScopeContext(DeclContext *);
229+
void lookUpTopLevelNamesInModuleScopeContext(DeclContext *);
230230

231231
#pragma mark ASTScope-based-lookup declarations
232232

@@ -435,7 +435,7 @@ void UnqualifiedLookupFactory::performUnqualifiedLookup() {
435435
lookupNamesIntroducedBy(dcAndIsCascadingUse);
436436
}
437437

438-
void UnqualifiedLookupFactory::lookupNonlocalsInModuleScopeContext(
438+
void UnqualifiedLookupFactory::lookUpTopLevelNamesInModuleScopeContext(
439439
DeclContext *DC) {
440440
// TODO: Does the debugger client care about compound names?
441441
if (Name.isSimpleName() && DebugClient &&
@@ -601,7 +601,7 @@ void UnqualifiedLookupFactory::lookIntoDeclarationContextForASTScopeLookup(
601601
// Lookup in the source file's scope marks the end.
602602
if (isa<SourceFile>(scopeDC)) {
603603
recordDependencyOnTopLevelName(scopeDC, Name, isCascadingUseResult);
604-
lookupNonlocalsInModuleScopeContext(scopeDC);
604+
lookUpTopLevelNamesInModuleScopeContext(scopeDC);
605605
return;
606606
}
607607

@@ -702,10 +702,10 @@ void UnqualifiedLookupFactory::lookupInModuleScopeContext(
702702
if (auto SF = dyn_cast<SourceFile>(dc))
703703
lookForLocalVariablesIn(SF);
704704
ifNotDoneYet([&] {
705-
// TODO: figure out why this line is here, not unconditional, or after
706-
// lookupNonLocals.
705+
// If no result has been found yet, the dependency must be on a top-level
706+
// name, since up to now, the search has been for non-top-level names.
707707
recordDependencyOnTopLevelName(dc, Name, isCascadingUse.getValueOr(true));
708-
lookupNonlocalsInModuleScopeContext(dc);
708+
lookUpTopLevelNamesInModuleScopeContext(dc);
709709
});
710710
}
711711

0 commit comments

Comments
 (0)