@@ -97,27 +97,12 @@ impl CoverageCounters {
97
97
}
98
98
}
99
99
100
- /// Shared helper used by [`Self::make_phys_node_counter`] and
101
- /// [`Self::make_phys_edge_counter`]. Don't call this directly.
102
- fn make_counter_inner ( & mut self , site : Site ) -> BcbCounter {
100
+ /// Creates a new physical counter for a BCB node or edge.
101
+ fn make_phys_counter ( & mut self , site : Site ) -> BcbCounter {
103
102
let id = self . counter_increment_sites . push ( site) ;
104
103
BcbCounter :: Counter { id }
105
104
}
106
105
107
- /// Creates a new physical counter for a BCB node.
108
- fn make_phys_node_counter ( & mut self , bcb : BasicCoverageBlock ) -> BcbCounter {
109
- self . make_counter_inner ( Site :: Node { bcb } )
110
- }
111
-
112
- /// Creates a new physical counter for a BCB edge.
113
- fn make_phys_edge_counter (
114
- & mut self ,
115
- from_bcb : BasicCoverageBlock ,
116
- to_bcb : BasicCoverageBlock ,
117
- ) -> BcbCounter {
118
- self . make_counter_inner ( Site :: Edge { from_bcb, to_bcb } )
119
- }
120
-
121
106
fn make_expression ( & mut self , lhs : BcbCounter , op : Op , rhs : BcbCounter ) -> BcbCounter {
122
107
let new_expr = BcbExpression { lhs, op, rhs } ;
123
108
* self
@@ -391,7 +376,7 @@ impl<'a> CountersBuilder<'a> {
391
376
// leading to infinite recursion.
392
377
if predecessors. len ( ) <= 1 || predecessors. contains ( & bcb) {
393
378
debug ! ( ?bcb, ?predecessors, "node has <=1 predecessors or is its own predecessor" ) ;
394
- let counter = self . counters . make_phys_node_counter ( bcb) ;
379
+ let counter = self . counters . make_phys_counter ( Site :: Node { bcb } ) ;
395
380
debug ! ( ?bcb, ?counter, "node gets a physical counter" ) ;
396
381
return counter;
397
382
}
@@ -448,7 +433,7 @@ impl<'a> CountersBuilder<'a> {
448
433
}
449
434
450
435
// Make a new counter to count this edge.
451
- let counter = self . counters . make_phys_edge_counter ( from_bcb, to_bcb) ;
436
+ let counter = self . counters . make_phys_counter ( Site :: Edge { from_bcb, to_bcb } ) ;
452
437
debug ! ( ?from_bcb, ?to_bcb, ?counter, "edge gets a physical counter" ) ;
453
438
counter
454
439
}
0 commit comments