about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/counters
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-01-22 13:55:08 +1100
committerZalathar <Zalathar@users.noreply.github.com>2025-02-06 21:44:31 +1100
commit20d051ec870739c8f263e5f6f581ca24a5dd56fd (patch)
treeec3355dad17588460d8ba1e0dd45160b97c13117 /compiler/rustc_mir_transform/src/coverage/counters
parentee7dc06cf181c073b1040669a40bc325d00f8c6d (diff)
downloadrust-20d051ec870739c8f263e5f6f581ca24a5dd56fd.tar.gz
rust-20d051ec870739c8f263e5f6f581ca24a5dd56fd.zip
coverage: Defer part of counter-creation until codegen
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/counters')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs25
1 files changed, 1 insertions, 24 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs
index 9d80b3af42d..91ed54b8b59 100644
--- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs
+++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs
@@ -9,6 +9,7 @@
 use rustc_data_structures::graph;
 use rustc_index::bit_set::DenseBitSet;
 use rustc_index::{Idx, IndexSlice, IndexVec};
+pub(crate) use rustc_middle::mir::coverage::NodeFlowData;
 use rustc_middle::mir::coverage::Op;
 
 use crate::coverage::counters::union_find::UnionFind;
@@ -16,30 +17,6 @@ use crate::coverage::counters::union_find::UnionFind;
 #[cfg(test)]
 mod tests;
 
-/// Data representing a view of some underlying graph, in which each node's
-/// successors have been merged into a single "supernode".
-///
-/// The resulting supernodes have no obvious meaning on their own.
-/// However, merging successor nodes means that a node's out-edges can all
-/// be combined into a single out-edge, whose flow is the same as the flow
-/// (execution count) of its corresponding node in the original graph.
-///
-/// With all node flows now in the original graph now represented as edge flows
-/// in the merged graph, it becomes possible to analyze the original node flows
-/// using techniques for analyzing edge flows.
-#[derive(Debug)]
-pub(crate) struct NodeFlowData<Node: Idx> {
-    /// Maps each node to the supernode that contains it, indicated by some
-    /// arbitrary "root" node that is part of that supernode.
-    supernodes: IndexVec<Node, Node>,
-    /// For each node, stores the single supernode that all of its successors
-    /// have been merged into.
-    ///
-    /// (Note that each node in a supernode can potentially have a _different_
-    /// successor supernode from its peers.)
-    succ_supernodes: IndexVec<Node, Node>,
-}
-
 /// Creates a "merged" view of an underlying graph.
 ///
 /// The given graph is assumed to have [“balanced flow”](balanced-flow),