@@ -12,7 +12,7 @@ use rustc_index::{Idx, IndexVec};
12
12
use rustc_middle:: mir:: coverage:: Op ;
13
13
14
14
use crate :: coverage:: counters:: iter_nodes:: IterNodes ;
15
- use crate :: coverage:: counters:: union_find:: { FrozenUnionFind , UnionFind } ;
15
+ use crate :: coverage:: counters:: union_find:: UnionFind ;
16
16
17
17
#[ cfg( test) ]
18
18
mod tests;
@@ -32,7 +32,7 @@ mod tests;
32
32
pub ( crate ) struct MergedNodeFlowGraph < Node : Idx > {
33
33
/// Maps each node to the supernode that contains it, indicated by some
34
34
/// arbitrary "root" node that is part of that supernode.
35
- supernodes : FrozenUnionFind < Node > ,
35
+ supernodes : IndexVec < Node , Node > ,
36
36
/// For each node, stores the single supernode that all of its successors
37
37
/// have been merged into.
38
38
///
@@ -66,11 +66,11 @@ impl<Node: Idx> MergedNodeFlowGraph<Node> {
66
66
} )
67
67
. collect :: < IndexVec < G :: Node , G :: Node > > ( ) ;
68
68
69
- // Now that unification is complete, freeze the supernode forest,
69
+ // Now that unification is complete, take a snapshot of the supernode forest,
70
70
// and resolve each arbitrarily-chosen successor to its canonical root.
71
71
// (This avoids having to explicitly resolve them later.)
72
- let supernodes = supernodes. freeze ( ) ;
73
- let succ_supernodes = successors. into_iter ( ) . map ( |succ| supernodes. find ( succ) ) . collect ( ) ;
72
+ let supernodes = supernodes. snapshot ( ) ;
73
+ let succ_supernodes = successors. into_iter ( ) . map ( |succ| supernodes[ succ] ) . collect ( ) ;
74
74
75
75
Self { supernodes, succ_supernodes }
76
76
}
@@ -80,7 +80,7 @@ impl<Node: Idx> MergedNodeFlowGraph<Node> {
80
80
}
81
81
82
82
fn is_supernode ( & self , node : Node ) -> bool {
83
- self . supernodes . find ( node) == node
83
+ self . supernodes [ node] == node
84
84
}
85
85
86
86
/// Using the information in this merged graph, together with a given
@@ -225,7 +225,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> {
225
225
226
226
// Get the supernode containing `this`, and make it the root of its
227
227
// component of the spantree.
228
- let this_supernode = self . graph . supernodes . find ( this) ;
228
+ let this_supernode = self . graph . supernodes [ this] ;
229
229
self . yank_to_spantree_root ( this_supernode) ;
230
230
231
231
// Get the supernode containing all of this's successors.
0 commit comments