From f1300c860e6ff4e024f0a347b87f94e36785ce49 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sun, 12 Jan 2025 21:36:07 +1100 Subject: coverage: Completely overhaul counter assignment, using node-flow graphs --- compiler/rustc_data_structures/src/graph/iterate/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_data_structures/src') 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 { + &self.visited + } } impl std::fmt::Debug for DepthFirstSearch -- cgit 1.4.1-3-g733a5