1
1
use super :: Error ;
2
2
3
- use super :: debug;
4
3
use super :: graph;
5
4
use super :: spans;
6
5
7
- use debug:: { DebugCounters , NESTED_INDENT } ;
8
6
use graph:: { BasicCoverageBlock , BcbBranch , CoverageGraph , TraverseCoverageGraphWithLoops } ;
9
7
use spans:: CoverageSpan ;
10
8
@@ -16,6 +14,8 @@ use rustc_middle::mir::coverage::*;
16
14
17
15
use std:: fmt:: { self , Debug } ;
18
16
17
+ const NESTED_INDENT : & str = " " ;
18
+
19
19
/// The coverage counter or counter expression associated with a particular
20
20
/// BCB node or BCB edge.
21
21
#[ derive( Clone ) ]
@@ -75,8 +75,6 @@ pub(super) struct CoverageCounters {
75
75
/// BCB/edge, but are needed as operands to more complex expressions.
76
76
/// These are always [`BcbCounter::Expression`].
77
77
pub ( super ) intermediate_expressions : Vec < BcbCounter > ,
78
-
79
- pub debug_counters : DebugCounters ,
80
78
}
81
79
82
80
impl CoverageCounters {
@@ -91,17 +89,9 @@ impl CoverageCounters {
91
89
bcb_edge_counters : FxHashMap :: default ( ) ,
92
90
bcb_has_incoming_edge_counters : BitSet :: new_empty ( num_bcbs) ,
93
91
intermediate_expressions : Vec :: new ( ) ,
94
-
95
- debug_counters : DebugCounters :: new ( ) ,
96
92
}
97
93
}
98
94
99
- /// Activate the `DebugCounters` data structures, to provide additional debug formatting
100
- /// features when formatting [`BcbCounter`] (counter) values.
101
- pub fn enable_debug ( & mut self ) {
102
- self . debug_counters . enable ( ) ;
103
- }
104
-
105
95
/// Makes [`BcbCounter`] `Counter`s and `Expressions` for the `BasicCoverageBlock`s directly or
106
96
/// indirectly associated with `CoverageSpans`, and accumulates additional `Expression`s
107
97
/// representing intermediate values.
@@ -113,44 +103,30 @@ impl CoverageCounters {
113
103
MakeBcbCounters :: new ( self , basic_coverage_blocks) . make_bcb_counters ( coverage_spans)
114
104
}
115
105
116
- fn make_counter < F > ( & mut self , debug_block_label_fn : F ) -> BcbCounter
106
+ fn make_counter < F > ( & mut self , _debug_block_label_fn : F ) -> BcbCounter
117
107
where
118
108
F : Fn ( ) -> Option < String > ,
119
109
{
120
- let counter = BcbCounter :: Counter { id : self . next_counter ( ) } ;
121
- if self . debug_counters . is_enabled ( ) {
122
- self . debug_counters . add_counter ( & counter, ( debug_block_label_fn) ( ) ) ;
123
- }
124
- counter
110
+ let id = self . next_counter ( ) ;
111
+ BcbCounter :: Counter { id }
125
112
}
126
113
127
114
fn make_expression < F > (
128
115
& mut self ,
129
116
lhs : Operand ,
130
117
op : Op ,
131
118
rhs : Operand ,
132
- debug_block_label_fn : F ,
119
+ _debug_block_label_fn : F ,
133
120
) -> BcbCounter
134
121
where
135
122
F : Fn ( ) -> Option < String > ,
136
123
{
137
124
let id = self . next_expression ( ) ;
138
- let expression = BcbCounter :: Expression { id, lhs, op, rhs } ;
139
- if self . debug_counters . is_enabled ( ) {
140
- self . debug_counters . add_counter ( & expression, ( debug_block_label_fn) ( ) ) ;
141
- }
142
- expression
125
+ BcbCounter :: Expression { id, lhs, op, rhs }
143
126
}
144
127
145
128
pub fn make_identity_counter ( & mut self , counter_operand : Operand ) -> BcbCounter {
146
- let some_debug_block_label = if self . debug_counters . is_enabled ( ) {
147
- self . debug_counters . some_block_label ( counter_operand) . cloned ( )
148
- } else {
149
- None
150
- } ;
151
- self . make_expression ( counter_operand, Op :: Add , Operand :: Zero , || {
152
- some_debug_block_label. clone ( )
153
- } )
129
+ self . make_expression ( counter_operand, Op :: Add , Operand :: Zero , || unreachable ! ( ) )
154
130
}
155
131
156
132
/// Counter IDs start from one and go up.
@@ -713,6 +689,6 @@ impl<'a> MakeBcbCounters<'a> {
713
689
714
690
#[ inline]
715
691
fn format_counter ( & self , counter_kind : & BcbCounter ) -> String {
716
- self . coverage_counters . debug_counters . format_counter ( counter_kind)
692
+ format ! ( "{ counter_kind:?}" )
717
693
}
718
694
}
0 commit comments