coverage: Move a debug print into make_code_region
This commit is contained in:
parent
cad50f40e5
commit
629437eec7
1 changed files with 11 additions and 8 deletions
|
@ -309,19 +309,14 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
|
||||||
};
|
};
|
||||||
graphviz_data.add_bcb_coverage_span_with_counter(bcb, &covspan, &counter_kind);
|
graphviz_data.add_bcb_coverage_span_with_counter(bcb, &covspan, &counter_kind);
|
||||||
|
|
||||||
debug!(
|
let code_region =
|
||||||
"Calling make_code_region(file_name={}, source_file={:?}, span={}, body_span={})",
|
make_code_region(source_map, file_name, &self.source_file, span, body_span);
|
||||||
file_name,
|
|
||||||
self.source_file,
|
|
||||||
source_map.span_to_diagnostic_string(span),
|
|
||||||
source_map.span_to_diagnostic_string(body_span)
|
|
||||||
);
|
|
||||||
|
|
||||||
inject_statement(
|
inject_statement(
|
||||||
self.mir_body,
|
self.mir_body,
|
||||||
counter_kind,
|
counter_kind,
|
||||||
self.bcb_leader_bb(bcb),
|
self.bcb_leader_bb(bcb),
|
||||||
Some(make_code_region(source_map, file_name, &self.source_file, span, body_span)),
|
Some(code_region),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -498,6 +493,14 @@ fn make_code_region(
|
||||||
span: Span,
|
span: Span,
|
||||||
body_span: Span,
|
body_span: Span,
|
||||||
) -> CodeRegion {
|
) -> CodeRegion {
|
||||||
|
debug!(
|
||||||
|
"Called make_code_region(file_name={}, source_file={:?}, span={}, body_span={})",
|
||||||
|
file_name,
|
||||||
|
source_file,
|
||||||
|
source_map.span_to_diagnostic_string(span),
|
||||||
|
source_map.span_to_diagnostic_string(body_span)
|
||||||
|
);
|
||||||
|
|
||||||
let (start_line, mut start_col) = source_file.lookup_file_pos(span.lo());
|
let (start_line, mut start_col) = source_file.lookup_file_pos(span.lo());
|
||||||
let (end_line, end_col) = if span.hi() == span.lo() {
|
let (end_line, end_col) = if span.hi() == span.lo() {
|
||||||
let (end_line, mut end_col) = (start_line, start_col);
|
let (end_line, mut end_col) = (start_line, start_col);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue