Skip to content

Commit

Permalink
coverage: Remove unnecessary bcb_successors
Browse files Browse the repository at this point in the history
Given that we directly access the graph predecessors/successors in so many
other places, and sometimes must do so to satisfy the borrow checker, there is
little value in having this trivial helper method.
  • Loading branch information
Zalathar committed Sep 15, 2024
1 parent f818c24 commit 004c2b9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_mir_transform/src/coverage/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ impl<'a> MakeBcbCounters<'a> {
}

// Determine the set of out-edges that don't yet have edge counters.
let candidate_successors = self
.bcb_successors(from_bcb)
let candidate_successors = self.basic_coverage_blocks.successors[from_bcb]
.iter()
.copied()
.filter(|&to_bcb| self.edge_has_no_counter(from_bcb, to_bcb))
Expand Down Expand Up @@ -502,11 +501,6 @@ impl<'a> MakeBcbCounters<'a> {
None
}

#[inline]
fn bcb_successors(&self, bcb: BasicCoverageBlock) -> &[BasicCoverageBlock] {
&self.basic_coverage_blocks.successors[bcb]
}

#[inline]
fn edge_has_no_counter(
&self,
Expand Down

0 comments on commit 004c2b9

Please sign in to comment.