coverage: Remove vestigial counter/expression debug labels
This commit is contained in:
parent
bbd347409f
commit
e015f5a370
@ -103,30 +103,18 @@ impl CoverageCounters {
|
|||||||
MakeBcbCounters::new(self, basic_coverage_blocks).make_bcb_counters(coverage_spans)
|
MakeBcbCounters::new(self, basic_coverage_blocks).make_bcb_counters(coverage_spans)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_counter<F>(&mut self, _debug_block_label_fn: F) -> BcbCounter
|
fn make_counter(&mut self) -> BcbCounter {
|
||||||
where
|
|
||||||
F: Fn() -> Option<String>,
|
|
||||||
{
|
|
||||||
let id = self.next_counter();
|
let id = self.next_counter();
|
||||||
BcbCounter::Counter { id }
|
BcbCounter::Counter { id }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_expression<F>(
|
fn make_expression(&mut self, lhs: Operand, op: Op, rhs: Operand) -> BcbCounter {
|
||||||
&mut self,
|
|
||||||
lhs: Operand,
|
|
||||||
op: Op,
|
|
||||||
rhs: Operand,
|
|
||||||
_debug_block_label_fn: F,
|
|
||||||
) -> BcbCounter
|
|
||||||
where
|
|
||||||
F: Fn() -> Option<String>,
|
|
||||||
{
|
|
||||||
let id = self.next_expression();
|
let id = self.next_expression();
|
||||||
BcbCounter::Expression { id, lhs, op, rhs }
|
BcbCounter::Expression { id, lhs, op, rhs }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_identity_counter(&mut self, counter_operand: Operand) -> BcbCounter {
|
pub fn make_identity_counter(&mut self, counter_operand: Operand) -> BcbCounter {
|
||||||
self.make_expression(counter_operand, Op::Add, Operand::Zero, || unreachable!())
|
self.make_expression(counter_operand, Op::Add, Operand::Zero)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Counter IDs start from one and go up.
|
/// Counter IDs start from one and go up.
|
||||||
@ -343,7 +331,6 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
branch_counter_operand,
|
branch_counter_operand,
|
||||||
Op::Add,
|
Op::Add,
|
||||||
sumup_counter_operand,
|
sumup_counter_operand,
|
||||||
|| None,
|
|
||||||
);
|
);
|
||||||
debug!(" [new intermediate expression: {:?}]", intermediate_expression);
|
debug!(" [new intermediate expression: {:?}]", intermediate_expression);
|
||||||
let intermediate_expression_operand = intermediate_expression.as_operand();
|
let intermediate_expression_operand = intermediate_expression.as_operand();
|
||||||
@ -367,7 +354,6 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
branching_counter_operand,
|
branching_counter_operand,
|
||||||
Op::Subtract,
|
Op::Subtract,
|
||||||
sumup_counter_operand,
|
sumup_counter_operand,
|
||||||
|| Some(format!("{expression_branch:?}")),
|
|
||||||
);
|
);
|
||||||
debug!("{:?} gets an expression: {:?}", expression_branch, expression);
|
debug!("{:?} gets an expression: {:?}", expression_branch, expression);
|
||||||
let bcb = expression_branch.target_bcb;
|
let bcb = expression_branch.target_bcb;
|
||||||
@ -404,7 +390,7 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
// program results in a tight infinite loop, but it should still compile.
|
// program results in a tight infinite loop, but it should still compile.
|
||||||
let one_path_to_target = self.bcb_has_one_path_to_target(bcb);
|
let one_path_to_target = self.bcb_has_one_path_to_target(bcb);
|
||||||
if one_path_to_target || self.bcb_predecessors(bcb).contains(&bcb) {
|
if one_path_to_target || self.bcb_predecessors(bcb).contains(&bcb) {
|
||||||
let counter_kind = self.coverage_counters.make_counter(|| Some(format!("{bcb:?}")));
|
let counter_kind = self.coverage_counters.make_counter();
|
||||||
if one_path_to_target {
|
if one_path_to_target {
|
||||||
debug!(
|
debug!(
|
||||||
"{}{:?} gets a new counter: {:?}",
|
"{}{:?} gets a new counter: {:?}",
|
||||||
@ -454,7 +440,6 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
sumup_edge_counter_operand,
|
sumup_edge_counter_operand,
|
||||||
Op::Add,
|
Op::Add,
|
||||||
edge_counter_operand,
|
edge_counter_operand,
|
||||||
|| None,
|
|
||||||
);
|
);
|
||||||
debug!(
|
debug!(
|
||||||
"{}new intermediate expression: {:?}",
|
"{}new intermediate expression: {:?}",
|
||||||
@ -470,7 +455,6 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
first_edge_counter_operand,
|
first_edge_counter_operand,
|
||||||
Op::Add,
|
Op::Add,
|
||||||
some_sumup_edge_counter_operand.unwrap(),
|
some_sumup_edge_counter_operand.unwrap(),
|
||||||
|| Some(format!("{bcb:?}")),
|
|
||||||
);
|
);
|
||||||
debug!(
|
debug!(
|
||||||
"{}{:?} gets a new counter (sum of predecessor counters): {:?}",
|
"{}{:?} gets a new counter (sum of predecessor counters): {:?}",
|
||||||
@ -517,8 +501,7 @@ impl<'a> MakeBcbCounters<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make a new counter to count this edge.
|
// Make a new counter to count this edge.
|
||||||
let counter_kind =
|
let counter_kind = self.coverage_counters.make_counter();
|
||||||
self.coverage_counters.make_counter(|| Some(format!("{from_bcb:?}->{to_bcb:?}")));
|
|
||||||
debug!(
|
debug!(
|
||||||
"{}Edge {:?}->{:?} gets a new counter: {:?}",
|
"{}Edge {:?}->{:?} gets a new counter: {:?}",
|
||||||
NESTED_INDENT.repeat(debug_indent_level),
|
NESTED_INDENT.repeat(debug_indent_level),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user