mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #74199 from cachemeifyoucan/eng/PR-128876895
[ScanDependencies] Make sure `canImport` resolution agrees with `import`
This commit is contained in:
@@ -1109,7 +1109,7 @@ public:
|
||||
///
|
||||
/// Note that even if this check succeeds, errors may still occur if the
|
||||
/// module is loaded in full.
|
||||
bool canImportModuleImpl(ImportPath::Module ModulePath,
|
||||
bool canImportModuleImpl(ImportPath::Module ModulePath, SourceLoc loc,
|
||||
llvm::VersionTuple version, bool underlyingVersion,
|
||||
bool updateFailingList,
|
||||
llvm::VersionTuple &foundVersion) const;
|
||||
@@ -1146,7 +1146,7 @@ public:
|
||||
///
|
||||
/// Note that even if this check succeeds, errors may still occur if the
|
||||
/// module is loaded in full.
|
||||
bool canImportModule(ImportPath::Module ModulePath,
|
||||
bool canImportModule(ImportPath::Module ModulePath, SourceLoc loc,
|
||||
llvm::VersionTuple version = llvm::VersionTuple(),
|
||||
bool underlyingVersion = false);
|
||||
|
||||
|
||||
@@ -830,6 +830,9 @@ ERROR(serialization_failed,none,
|
||||
"serialization of module %0 failed due to the errors above",
|
||||
(const ModuleDecl *))
|
||||
|
||||
WARNING(can_import_invalid_swiftmodule,none,
|
||||
"canImport() evaluated to false due to invalid swiftmodule: %0", (StringRef))
|
||||
|
||||
ERROR(serialization_load_failed,Fatal,
|
||||
"failed to load module '%0'", (StringRef))
|
||||
ERROR(module_interface_build_failed,Fatal,
|
||||
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
///
|
||||
/// If a non-null \p versionInfo is provided, the module version will be
|
||||
/// parsed and populated.
|
||||
virtual bool canImportModule(ImportPath::Module named,
|
||||
virtual bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableImport = false) = 0;
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
///
|
||||
/// If a non-null \p versionInfo is provided, the module version will be
|
||||
/// parsed and populated.
|
||||
virtual bool canImportModule(ImportPath::Module named,
|
||||
virtual bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableImport = false) override;
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
|
||||
bool SkipBuildingInterface, bool IsFramework,
|
||||
bool IsTestableDependencyLookup = false) override;
|
||||
|
||||
bool canImportModule(ImportPath::Module named,
|
||||
bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
@@ -212,7 +212,7 @@ class ExplicitCASModuleLoader : public SerializedModuleLoaderBase {
|
||||
bool SkipBuildingInterface, bool IsFramework,
|
||||
bool IsTestableDependencyLookup = false) override;
|
||||
|
||||
bool canImportModule(ImportPath::Module named,
|
||||
bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
|
||||
@@ -59,9 +59,10 @@ public:
|
||||
///
|
||||
/// If a non-null \p versionInfo is provided, the module version will be
|
||||
/// parsed and populated.
|
||||
virtual bool canImportModule(ImportPath::Module named,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
virtual bool
|
||||
canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
/// Import a module with the given module path.
|
||||
///
|
||||
|
||||
@@ -209,9 +209,10 @@ public:
|
||||
///
|
||||
/// If a non-null \p versionInfo is provided, the module version will be
|
||||
/// parsed and populated.
|
||||
virtual bool canImportModule(ImportPath::Module named,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
virtual bool
|
||||
canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
/// Import a module with the given module path.
|
||||
///
|
||||
@@ -339,7 +340,7 @@ class MemoryBufferSerializedModuleLoader : public SerializedModuleLoaderBase {
|
||||
public:
|
||||
virtual ~MemoryBufferSerializedModuleLoader();
|
||||
|
||||
bool canImportModule(ImportPath::Module named,
|
||||
bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user