Skip to content

Commit 507c053

Browse files
committed
coverage: Remove vestigial counter/expression debug labels
1 parent c31cace commit 507c053

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

Diff for: compiler/rustc_mir_transform/src/coverage/counters.rs

+5-22
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,18 @@ impl CoverageCounters {
103103
MakeBcbCounters::new(self, basic_coverage_blocks).make_bcb_counters(coverage_spans)
104104
}
105105

106-
fn make_counter<F>(&mut self, _debug_block_label_fn: F) -> BcbCounter
107-
where
108-
F: Fn() -> Option<String>,
109-
{
106+
fn make_counter(&mut self) -> BcbCounter {
110107
let id = self.next_counter();
111108
BcbCounter::Counter { id }
112109
}
113110

114-
fn make_expression<F>(
115-
&mut self,
116-
lhs: Operand,
117-
op: Op,
118-
rhs: Operand,
119-
_debug_block_label_fn: F,
120-
) -> BcbCounter
121-
where
122-
F: Fn() -> Option<String>,
123-
{
111+
fn make_expression(&mut self, lhs: Operand, op: Op, rhs: Operand) -> BcbCounter {
124112
let id = self.next_expression();
125113
BcbCounter::Expression { id, lhs, op, rhs }
126114
}
127115

128116
pub fn make_identity_counter(&mut self, counter_operand: Operand) -> BcbCounter {
129-
self.make_expression(counter_operand, Op::Add, Operand::Zero, || unreachable!())
117+
self.make_expression(counter_operand, Op::Add, Operand::Zero)
130118
}
131119

132120
/// Counter IDs start from one and go up.
@@ -343,7 +331,6 @@ impl<'a> MakeBcbCounters<'a> {
343331
branch_counter_operand,
344332
Op::Add,
345333
sumup_counter_operand,
346-
|| None,
347334
);
348335
debug!(" [new intermediate expression: {:?}]", intermediate_expression);
349336
let intermediate_expression_operand = intermediate_expression.as_operand();
@@ -367,7 +354,6 @@ impl<'a> MakeBcbCounters<'a> {
367354
branching_counter_operand,
368355
Op::Subtract,
369356
sumup_counter_operand,
370-
|| Some(format!("{expression_branch:?}")),
371357
);
372358
debug!("{:?} gets an expression: {:?}", expression_branch, expression);
373359
let bcb = expression_branch.target_bcb;
@@ -404,7 +390,7 @@ impl<'a> MakeBcbCounters<'a> {
404390
// program results in a tight infinite loop, but it should still compile.
405391
let one_path_to_target = self.bcb_has_one_path_to_target(bcb);
406392
if one_path_to_target || self.bcb_predecessors(bcb).contains(&bcb) {
407-
let counter_kind = self.coverage_counters.make_counter(|| Some(format!("{bcb:?}")));
393+
let counter_kind = self.coverage_counters.make_counter();
408394
if one_path_to_target {
409395
debug!(
410396
"{}{:?} gets a new counter: {:?}",
@@ -454,7 +440,6 @@ impl<'a> MakeBcbCounters<'a> {
454440
sumup_edge_counter_operand,
455441
Op::Add,
456442
edge_counter_operand,
457-
|| None,
458443
);
459444
debug!(
460445
"{}new intermediate expression: {:?}",
@@ -470,7 +455,6 @@ impl<'a> MakeBcbCounters<'a> {
470455
first_edge_counter_operand,
471456
Op::Add,
472457
some_sumup_edge_counter_operand.unwrap(),
473-
|| Some(format!("{bcb:?}")),
474458
);
475459
debug!(
476460
"{}{:?} gets a new counter (sum of predecessor counters): {:?}",
@@ -517,8 +501,7 @@ impl<'a> MakeBcbCounters<'a> {
517501
}
518502

519503
// Make a new counter to count this edge.
520-
let counter_kind =
521-
self.coverage_counters.make_counter(|| Some(format!("{from_bcb:?}->{to_bcb:?}")));
504+
let counter_kind = self.coverage_counters.make_counter();
522505
debug!(
523506
"{}Edge {:?}->{:?} gets a new counter: {:?}",
524507
NESTED_INDENT.repeat(debug_indent_level),

0 commit comments

Comments
 (0)