Converting ModuleDecl::ImportedModule from std::pair to a dedicated struct. (#31360)

This commit is contained in:
Daniel Sweeney
2020-04-30 21:26:03 -06:00
committed by GitHub
parent f503a2d58a
commit ea526c6383
25 changed files with 211 additions and 171 deletions

View File

@@ -108,7 +108,7 @@ public:
/// Represents another module that has been imported as a dependency.
class Dependency {
public:
ModuleDecl::ImportedModule Import = {};
llvm::Optional<ModuleDecl::ImportedModule> Import = llvm::None;
const StringRef RawPath;
const StringRef RawSPIs;
SmallVector<Identifier, 4> spiGroups;
@@ -146,7 +146,7 @@ public:
}
bool isLoaded() const {
return Import.second != nullptr;
return Import.hasValue() && Import->importedModule != nullptr;
}
bool isExported() const {