NFC: Rename NameBinding to ImportResolution

This commit is contained in:
Hamish Knight
2020-03-28 15:11:23 -07:00
parent e8cbe76cba
commit d2434e1bf7
10 changed files with 77 additions and 83 deletions

View File

@@ -752,7 +752,7 @@ shouldImplicityImportSwiftOnoneSupportModule(CompilerInvocation &Invocation) {
}
void CompilerInstance::performParseAndResolveImportsOnly() {
performSemaUpTo(SourceFile::NameBound);
performSemaUpTo(SourceFile::ImportsResolved);
}
void CompilerInstance::performSema() {
@@ -926,12 +926,12 @@ void CompilerInstance::parseAndCheckTypesUpTo(
auto *SF = dyn_cast<SourceFile>(File);
if (!SF)
return true;
return SF->ASTStage >= SourceFile::NameBound;
return SF->ASTStage >= SourceFile::ImportsResolved;
}) && "some files have not yet had their imports resolved");
MainModule->setHasResolvedImports();
forEachFileToTypeCheck([&](SourceFile &SF) {
if (limitStage == SourceFile::NameBound) {
if (limitStage == SourceFile::ImportsResolved) {
bindExtensions(SF);
return;
}
@@ -951,8 +951,8 @@ void CompilerInstance::parseAndCheckTypesUpTo(
}
});
// If the limiting AST stage is name binding, we're done.
if (limitStage <= SourceFile::NameBound) {
// If the limiting AST stage is import resolution, we're done.
if (limitStage <= SourceFile::ImportsResolved) {
return;
}
@@ -967,8 +967,8 @@ void CompilerInstance::parseLibraryFile(
SourceFileKind::Library, implicitImports.kind, BufferID);
addAdditionalInitialImportsTo(NextInput, implicitImports);
// Name binding will lazily trigger parsing of the file.
performNameBinding(*NextInput);
// Import resolution will lazily trigger parsing of the file.
performImportResolution(*NextInput);
}
bool CompilerInstance::parsePartialModulesAndLibraryFiles(
@@ -997,7 +997,7 @@ bool CompilerInstance::parsePartialModulesAndLibraryFiles(
void CompilerInstance::parseAndTypeCheckMainFileUpTo(
SourceFile::ASTStage_t LimitStage) {
assert(LimitStage >= SourceFile::NameBound);
assert(LimitStage >= SourceFile::ImportsResolved);
FrontendStatsTracer tracer(getStatsReporter(),
"parse-and-typecheck-main-file");
bool mainIsPrimary =
@@ -1010,13 +1010,13 @@ void CompilerInstance::parseAndTypeCheckMainFileUpTo(
auto DidSuppressWarnings = Diags.getSuppressWarnings();
Diags.setSuppressWarnings(DidSuppressWarnings || !mainIsPrimary);
// For a primary, perform type checking if needed. Otherwise, just do name
// binding.
// For a primary, perform type checking if needed. Otherwise, just do import
// resolution.
if (mainIsPrimary && LimitStage >= SourceFile::TypeChecked) {
performTypeChecking(MainFile);
} else {
assert(!TheSILModule && "Should perform type checking for SIL");
performNameBinding(MainFile);
performImportResolution(MainFile);
}
// Parse the SIL decls if needed.