mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -656,19 +656,6 @@ struct llvm::DenseMapInfo<ModuleIdentifierArrayKind> {
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<ModuleDependencyID> {
|
||||
using UnderlyingKindType = std::underlying_type<ModuleDependencyKind>::type;
|
||||
std::size_t operator()(const ModuleDependencyID &id) const {
|
||||
auto underlyingKindValue = static_cast<UnderlyingKindType>(id.second);
|
||||
|
||||
return (hash<string>()(id.first) ^
|
||||
(hash<UnderlyingKindType>()(underlyingKindValue)));
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
namespace swift {
|
||||
|
||||
class ModuleDependenciesCacheSerializer {
|
||||
|
||||
Reference in New Issue
Block a user