mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Always record best version of discovered 'canImport'-ed modules
Suppose module 'Foo' exists in the search paths and specifies user module version '1.0'. If the first encountered 'canImport' query is unversioned: ... Followed by a versioned one: ... The success of the first check will record an unversioned successful canImport, which will cause the second check to evaluate to 'true', which is incorrect. This change causes even unversioned 'canImport' checks to track and record the discovered user module version.
This commit is contained in:
@@ -1185,11 +1185,13 @@ public:
|
||||
bool canImportModuleImpl(ImportPath::Module ModulePath, SourceLoc loc,
|
||||
llvm::VersionTuple version, bool underlyingVersion,
|
||||
bool isSourceCanImport,
|
||||
llvm::VersionTuple &foundVersion) const;
|
||||
llvm::VersionTuple &foundVersion,
|
||||
llvm::VersionTuple &foundUnderlyingClangVersion) const;
|
||||
|
||||
/// Add successful canImport modules.
|
||||
void addSucceededCanImportModule(StringRef moduleName, bool underlyingVersion,
|
||||
const llvm::VersionTuple &versionInfo);
|
||||
void addSucceededCanImportModule(StringRef moduleName,
|
||||
const llvm::VersionTuple &versionInfo,
|
||||
const llvm::VersionTuple &underlyingVersionInfo);
|
||||
|
||||
public:
|
||||
namelookup::ImportCache &getImportCache() const;
|
||||
|
||||
Reference in New Issue
Block a user