[NFC] Move several types/functions to Import.h

To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h:

* ImplicitImports
* ImplicitStdlibKind
* ImplicitImportInfo
* ModuleDecl::ImportedModule
* ModuleDecl::OrderImportedModules (as ImportedModule::Order)
* ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates())
* SourceFile::ImportFlags
* SourceFile::ImportOptions
* SourceFile::ImportedModuleDesc

This commit is large and intentionally kept mechanical—nothing interesting to see here.
This commit is contained in:
Brent Royal-Gordon
2020-09-25 13:48:30 -07:00
parent a26fc5516d
commit b440ab7331
31 changed files with 350 additions and 357 deletions

View File

@@ -354,7 +354,7 @@ ImportDepth::ImportDepth(ASTContext &context,
// Private imports from this module.
// FIXME: only the private imports from the current source file.
// FIXME: ImportFilterKind::ShadowedByCrossImportOverlay?
SmallVector<ModuleDecl::ImportedModule, 16> mainImports;
SmallVector<ImportedModule, 16> mainImports;
main->getImportedModules(mainImports,
{ModuleDecl::ImportFilterKind::Default,
ModuleDecl::ImportFilterKind::ImplementationOnly});
@@ -384,7 +384,7 @@ ImportDepth::ImportDepth(ASTContext &context,
}
// Add imports to the worklist.
SmallVector<ModuleDecl::ImportedModule, 16> imports;
SmallVector<ImportedModule, 16> imports;
module->getImportedModules(imports);
for (auto &import : imports) {
uint8_t next = std::max(depth, uint8_t(depth + 1)); // unsigned wrap