diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-01-12 21:36:07 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-01-16 22:07:18 +1100 |
| commit | f1300c860e6ff4e024f0a347b87f94e36785ce49 (patch) | |
| tree | bf8a51064c780c9e18fbb2dfb131a983b1fb8f3b /compiler/rustc_data_structures/src/graph | |
| parent | e70112caf86dac4a01739538d3e6f3d163e47642 (diff) | |
| download | rust-f1300c860e6ff4e024f0a347b87f94e36785ce49.tar.gz rust-f1300c860e6ff4e024f0a347b87f94e36785ce49.zip | |
coverage: Completely overhaul counter assignment, using node-flow graphs
Diffstat (limited to 'compiler/rustc_data_structures/src/graph')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/iterate/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/graph/iterate/mod.rs b/compiler/rustc_data_structures/src/graph/iterate/mod.rs index ecda7d3fba8..7b4573d7a84 100644 --- a/compiler/rustc_data_structures/src/graph/iterate/mod.rs +++ b/compiler/rustc_data_structures/src/graph/iterate/mod.rs @@ -125,6 +125,16 @@ where pub fn visited(&self, node: G::Node) -> bool { self.visited.contains(node) } + + /// Returns a reference to the set of nodes that have been visited, with + /// the same caveats as [`Self::visited`]. + /// + /// When incorporating the visited nodes into another bitset, using bulk + /// operations like `union` or `intersect` can be more efficient than + /// processing each node individually. + pub fn visited_set(&self) -> &DenseBitSet<G::Node> { + &self.visited + } } impl<G> std::fmt::Debug for DepthFirstSearch<G> |
