Extends canImport to check for submodule availability

This commit is contained in:
ApolloZhu
2021-07-05 22:13:37 -04:00
committed by Apollo Zhu
parent d1bb98b11e
commit 683d469fcd
24 changed files with 294 additions and 51 deletions

View File

@@ -1828,8 +1828,11 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
return std::make_error_code(std::errc::not_supported);
}
bool ExplicitSwiftModuleLoader::canImportModule(
ImportPath::Element mID, llvm::VersionTuple version, bool underlyingVersion) {
bool ExplicitSwiftModuleLoader::canImportModule(ImportPath::Module path,
llvm::VersionTuple version,
bool underlyingVersion) {
// FIXME: Swift submodules?
ImportPath::Element mID = path.front();
// Look up the module with the real name (physical name on disk);
// in case `-module-alias` is used, the name appearing in source files
// and the real module name are different. For example, '-module-alias Foo=Bar'