[Dependency Scanning] Do not add cross-import overlays that involve the main module being scanned

For example, when scanning a source module `Foo`, which, when depending on module `Bar` causes a cross-import overlay `_Foo_Bar` to be added, do not add this cross-import overlay when scanning `Foo` itself. For example, if `Foo` adds a dependency on `Bar` itself in its own dependency graph.
This commit is contained in:
Artem Chikin
2023-03-27 14:15:12 -07:00
parent 60ffd84e19
commit 817f0ffb41
5 changed files with 36 additions and 2 deletions

View File

@@ -211,8 +211,6 @@ ModuleDependencyInfo::collectCrossImportOverlayNames(ASTContext &ctx,
break;
}
case swift::ModuleDependencyKind::SwiftSource: {
auto *swiftSourceDep = getAsSwiftSourceModule();
assert(!swiftSourceDep->sourceFiles.empty());
return result;
}
case swift::ModuleDependencyKind::SwiftPlaceholder: {