Skip to content

Commit d1920c5

Browse files
committed
coverage: Rename next_bcb to just bcb
This is the only BCB that `TraverseCoverageGraphWithLoops::next` works with, so calling it `next_bcb` just makes the code less clear.
1 parent a7ae2a6 commit d1920c5

File tree

1 file changed

+10
-9
lines changed
  • compiler/rustc_mir_transform/src/coverage

1 file changed

+10
-9
lines changed

compiler/rustc_mir_transform/src/coverage/graph.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -431,21 +431,22 @@ impl TraverseCoverageGraphWithLoops {
431431
);
432432

433433
while let Some(context) = self.context_stack.last_mut() {
434-
if let Some(next_bcb) = context.worklist.pop() {
435-
if !self.visited.insert(next_bcb) {
436-
debug!("Already visited: {:?}", next_bcb);
434+
if let Some(bcb) = context.worklist.pop() {
435+
if !self.visited.insert(bcb) {
436+
debug!("Already visited: {bcb:?}");
437437
continue;
438438
}
439-
debug!("Visiting {:?}", next_bcb);
440-
if self.backedges[next_bcb].len() > 0 {
441-
debug!("{:?} is a loop header! Start a new TraversalContext...", next_bcb);
439+
debug!("Visiting {bcb:?}");
440+
441+
if self.backedges[bcb].len() > 0 {
442+
debug!("{bcb:?} is a loop header! Start a new TraversalContext...");
442443
self.context_stack.push(TraversalContext {
443-
loop_backedges: Some((self.backedges[next_bcb].clone(), next_bcb)),
444+
loop_backedges: Some((self.backedges[bcb].clone(), bcb)),
444445
worklist: Vec::new(),
445446
});
446447
}
447-
self.extend_worklist(basic_coverage_blocks, next_bcb);
448-
return Some(next_bcb);
448+
self.extend_worklist(basic_coverage_blocks, bcb);
449+
return Some(bcb);
449450
} else {
450451
// Strip contexts with empty worklists from the top of the stack
451452
self.context_stack.pop();

0 commit comments

Comments
 (0)