[Dependency Scanning] Specify dependency inputs of Swift module dependencies on the command line

Do this by computing a transitive closure on the computed dependency graph, relying on the fact that it is a DAG.
The used algorithm is:
```
for each v ∈ V {
    T(v) = { v }
}
for v ∈ V in reverse topological order {
    for each (v, w) ∈ E {
         T(v) = T(v) ∪ T(w)
    }
}
```
This commit is contained in:
Artem Chikin
2023-02-03 16:49:00 -08:00
parent c1599fede4
commit c989823775
7 changed files with 305 additions and 70 deletions

View File

@@ -129,7 +129,8 @@ class SearchPathOptions;
class CompilerInvocation;
/// A ModuleLoader that loads explicitly built Swift modules specified via
/// -swift-module-file or modules found in
/// -swift-module-file or modules found in a provided
/// -explicit-swift-module-map-file JSON input.
class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
explicit ExplicitSwiftModuleLoader(ASTContext &ctx, DependencyTracker *tracker,
ModuleLoadingMode loadMode,