mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Parser: teach canImport to take an additional parameter indicating the minimum module version
canImport should be able to take an additional parameter labeled by either version or underlyingVersion. We need underlyingVersion for clang modules with Swift overlays because they have separate version numbers. The library users are usually interested in checking the importability of the underlying clang module instead of its Swift overlay. Part of rdar://73992299
This commit is contained in:
@@ -1629,7 +1629,7 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
|
||||
}
|
||||
|
||||
bool ExplicitSwiftModuleLoader::canImportModule(
|
||||
ImportPath::Element mID) {
|
||||
ImportPath::Element mID, llvm::VersionTuple version, bool underlyingVersion) {
|
||||
StringRef moduleName = mID.Item.str();
|
||||
auto it = Impl.ExplicitModuleMap.find(moduleName);
|
||||
// If no provided explicit module matches the name, then it cannot be imported.
|
||||
|
||||
Reference in New Issue
Block a user