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:
@@ -166,7 +166,9 @@ public:
|
||||
///
|
||||
/// Note that even if this check succeeds, errors may still occur if the
|
||||
/// module is loaded in full.
|
||||
virtual bool canImportModule(ImportPath::Element named) override;
|
||||
virtual bool canImportModule(ImportPath::Element named,
|
||||
llvm::VersionTuple version,
|
||||
bool underlyingVersion) override;
|
||||
|
||||
/// Import a module with the given module path.
|
||||
///
|
||||
@@ -274,7 +276,8 @@ class MemoryBufferSerializedModuleLoader : public SerializedModuleLoaderBase {
|
||||
public:
|
||||
virtual ~MemoryBufferSerializedModuleLoader();
|
||||
|
||||
bool canImportModule(ImportPath::Element named) override;
|
||||
bool canImportModule(ImportPath::Element named, llvm::VersionTuple version,
|
||||
bool underlyingVersion) override;
|
||||
ModuleDecl *
|
||||
loadModule(SourceLoc importLoc,
|
||||
ImportPath::Module path) override;
|
||||
|
||||
Reference in New Issue
Block a user