mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Model main module as separate dependency kind: SwiftSource
These kinds of modules differ from `SwiftTextual` modules in that they do not have an interface and have source-files. It is cleaner to enforce this distinction with types, instead of checking for interface optionality everywhere.
This commit is contained in:
@@ -121,7 +121,7 @@ ErrorOr<ModuleDependencies> ModuleDependencyScanner::scanInterfaceFile(
|
||||
std::string InPath = moduleInterfacePath.str();
|
||||
auto compiledCandidates = getCompiledCandidates(Ctx, moduleName.str(),
|
||||
InPath);
|
||||
Result = ModuleDependencies::forSwiftTextualModule(InPath,
|
||||
Result = ModuleDependencies::forSwiftInterfaceModule(InPath,
|
||||
compiledCandidates,
|
||||
Args,
|
||||
PCMArgs,
|
||||
@@ -163,10 +163,15 @@ Optional<ModuleDependencies> SerializedModuleLoaderBase::getModuleDependencies(
|
||||
StringRef moduleName, ModuleDependenciesCache &cache,
|
||||
InterfaceSubContextDelegate &delegate) {
|
||||
auto currentSearchPathSet = Ctx.getAllModuleSearchPathsSet();
|
||||
|
||||
// Check whether we've cached this result.
|
||||
if (auto found = cache.findDependencies(
|
||||
moduleName,
|
||||
{ModuleDependenciesKind::SwiftTextual, currentSearchPathSet}))
|
||||
{ModuleDependenciesKind::SwiftInterface, currentSearchPathSet}))
|
||||
return found;
|
||||
if (auto found = cache.findDependencies(
|
||||
moduleName,
|
||||
{ModuleDependenciesKind::SwiftSource, currentSearchPathSet}))
|
||||
return found;
|
||||
if (auto found = cache.findDependencies(
|
||||
moduleName,
|
||||
|
||||
Reference in New Issue
Block a user