mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -948,7 +948,7 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
|
||||
}
|
||||
|
||||
bool SerializedModuleLoaderBase::canImportModule(
|
||||
ImportPath::Element mID) {
|
||||
ImportPath::Element mID, llvm::VersionTuple version, bool underlyingVersion) {
|
||||
// Look on disk.
|
||||
SmallVector<char, 0> *unusedModuleInterfacePath = nullptr;
|
||||
std::unique_ptr<llvm::MemoryBuffer> *unusedModuleBuffer = nullptr;
|
||||
@@ -962,7 +962,7 @@ bool SerializedModuleLoaderBase::canImportModule(
|
||||
}
|
||||
|
||||
bool MemoryBufferSerializedModuleLoader::canImportModule(
|
||||
ImportPath::Element mID) {
|
||||
ImportPath::Element mID, llvm::VersionTuple version, bool underlyingVersion) {
|
||||
// See if we find it in the registered memory buffers.
|
||||
return MemoryBuffers.count(mID.Item.str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user