[Dependency Scanning] Introduce a new constructor for dummy source modules

Instead of passing in a bunch of dummy/empty data.
This commit is contained in:
Artem Chikin
2024-12-19 16:12:47 -08:00
parent 5961b9a00b
commit 7049c5bfea
4 changed files with 25 additions and 3 deletions

View File

@@ -1161,13 +1161,13 @@ void ModuleDependencyScanner::discoverCrossImportOverlayDependencies(
// Construct a dummy main to resolve the newly discovered cross import
// overlays.
StringRef dummyMainName = "DummyMainModuleForResolvingCrossImportOverlays";
StringRef dummyMainName = "MainModuleCrossImportOverlays";
auto dummyMainID = ModuleDependencyID{dummyMainName.str(),
ModuleDependencyKind::SwiftSource};
auto actualMainID = ModuleDependencyID{mainModuleName.str(),
ModuleDependencyKind::SwiftSource};
auto dummyMainDependencies =
ModuleDependencyInfo::forSwiftSourceModule({}, {}, {}, {}, {}, {});
ModuleDependencyInfo::forSwiftSourceModule();
std::for_each(newOverlays.begin(), newOverlays.end(),
[&](Identifier modName) {
dummyMainDependencies.addModuleImport(modName.str());