@@ -17,7 +17,8 @@ const ID_SEPARATOR: &str = ",";
1717/// `CoverageKind` counter (to be added by `CoverageCounters::make_bcb_counters`), and an optional
1818/// set of additional counters--if needed--to count incoming edges, if there are more than one.
1919/// (These "edge counters" are eventually converted into new MIR `BasicBlock`s.)
20- pub ( crate ) struct CoverageGraph {
20+ #[ derive( Debug ) ]
21+ pub ( super ) struct CoverageGraph {
2122 bcbs : IndexVec < BasicCoverageBlock , BasicCoverageBlockData > ,
2223 bb_to_bcb : IndexVec < BasicBlock , Option < BasicCoverageBlock > > ,
2324 pub successors : IndexVec < BasicCoverageBlock , Vec < BasicCoverageBlock > > ,
@@ -275,7 +276,7 @@ impl graph::WithPredecessors for CoverageGraph {
275276
276277rustc_index:: newtype_index! {
277278 /// A node in the [control-flow graph][CFG] of CoverageGraph.
278- pub ( crate ) struct BasicCoverageBlock {
279+ pub ( super ) struct BasicCoverageBlock {
279280 DEBUG_FORMAT = "bcb{}" ,
280281 }
281282}
@@ -305,7 +306,7 @@ rustc_index::newtype_index! {
305306/// queries (`is_dominated_by()`, `predecessors`, `successors`, etc.) have branch (control flow)
306307/// significance.
307308#[ derive( Debug , Clone ) ]
308- pub ( crate ) struct BasicCoverageBlockData {
309+ pub ( super ) struct BasicCoverageBlockData {
309310 pub basic_blocks : Vec < BasicBlock > ,
310311 pub counter_kind : Option < CoverageKind > ,
311312 edge_from_bcbs : Option < FxHashMap < BasicCoverageBlock , CoverageKind > > ,
@@ -431,7 +432,7 @@ impl BasicCoverageBlockData {
431432/// the specific branching BCB, representing the edge between the two. The latter case
432433/// distinguishes this incoming edge from other incoming edges to the same `target_bcb`.
433434#[ derive( Clone , Copy , PartialEq , Eq ) ]
434- pub ( crate ) struct BcbBranch {
435+ pub ( super ) struct BcbBranch {
435436 pub edge_from_bcb : Option < BasicCoverageBlock > ,
436437 pub target_bcb : BasicCoverageBlock ,
437438}
@@ -498,9 +499,8 @@ fn bcb_filtered_successors<'a, 'tcx>(
498499/// Maintains separate worklists for each loop in the BasicCoverageBlock CFG, plus one for the
499500/// CoverageGraph outside all loops. This supports traversing the BCB CFG in a way that
500501/// ensures a loop is completely traversed before processing Blocks after the end of the loop.
501- // FIXME(richkadel): Add unit tests for TraversalContext.
502502#[ derive( Debug ) ]
503- pub ( crate ) struct TraversalContext {
503+ pub ( super ) struct TraversalContext {
504504 /// From one or more backedges returning to a loop header.
505505 pub loop_backedges : Option < ( Vec < BasicCoverageBlock > , BasicCoverageBlock ) > ,
506506
@@ -510,7 +510,7 @@ pub(crate) struct TraversalContext {
510510 pub worklist : Vec < BasicCoverageBlock > ,
511511}
512512
513- pub ( crate ) struct TraverseCoverageGraphWithLoops {
513+ pub ( super ) struct TraverseCoverageGraphWithLoops {
514514 pub backedges : IndexVec < BasicCoverageBlock , Vec < BasicCoverageBlock > > ,
515515 pub context_stack : Vec < TraversalContext > ,
516516 visited : BitSet < BasicCoverageBlock > ,
@@ -642,7 +642,7 @@ impl TraverseCoverageGraphWithLoops {
642642 }
643643}
644644
645- fn find_loop_backedges (
645+ pub ( super ) fn find_loop_backedges (
646646 basic_coverage_blocks : & CoverageGraph ,
647647) -> IndexVec < BasicCoverageBlock , Vec < BasicCoverageBlock > > {
648648 let num_bcbs = basic_coverage_blocks. num_nodes ( ) ;
0 commit comments