@@ -209,8 +209,8 @@ impl CoverageGraph {
209
209
}
210
210
211
211
#[ inline( always) ]
212
- pub fn is_dominated_by ( & self , node : BasicCoverageBlock , dom : BasicCoverageBlock ) -> bool {
213
- self . dominators . as_ref ( ) . unwrap ( ) . is_dominated_by ( node , dom )
212
+ pub fn dominates ( & self , dom : BasicCoverageBlock , node : BasicCoverageBlock ) -> bool {
213
+ self . dominators . as_ref ( ) . unwrap ( ) . dominates ( dom , node )
214
214
}
215
215
216
216
#[ inline( always) ]
@@ -312,7 +312,7 @@ rustc_index::newtype_index! {
312
312
/// to the BCB's primary counter or expression).
313
313
///
314
314
/// The BCB CFG is critical to simplifying the coverage analysis by ensuring graph path-based
315
- /// queries (`is_dominated_by ()`, `predecessors`, `successors`, etc.) have branch (control flow)
315
+ /// queries (`dominates ()`, `predecessors`, `successors`, etc.) have branch (control flow)
316
316
/// significance.
317
317
#[ derive( Debug , Clone ) ]
318
318
pub ( super ) struct BasicCoverageBlockData {
@@ -594,7 +594,7 @@ impl TraverseCoverageGraphWithLoops {
594
594
// branching block would have given an `Expression` (or vice versa).
595
595
let ( some_successor_to_add, some_loop_header) =
596
596
if let Some ( ( _, loop_header) ) = context. loop_backedges {
597
- if basic_coverage_blocks. is_dominated_by ( successor , loop_header ) {
597
+ if basic_coverage_blocks. dominates ( loop_header , successor ) {
598
598
( Some ( successor) , Some ( loop_header) )
599
599
} else {
600
600
( None , None )
@@ -666,15 +666,15 @@ pub(super) fn find_loop_backedges(
666
666
//
667
667
// The overall complexity appears to be comparable to many other MIR transform algorithms, and I
668
668
// don't expect that this function is creating a performance hot spot, but if this becomes an
669
- // issue, there may be ways to optimize the `is_dominated_by ` algorithm (as indicated by an
669
+ // issue, there may be ways to optimize the `dominates ` algorithm (as indicated by an
670
670
// existing `FIXME` comment in that code), or possibly ways to optimize it's usage here, perhaps
671
671
// by keeping track of results for visited `BasicCoverageBlock`s if they can be used to short
672
- // circuit downstream `is_dominated_by ` checks.
672
+ // circuit downstream `dominates ` checks.
673
673
//
674
674
// For now, that kind of optimization seems unnecessarily complicated.
675
675
for ( bcb, _) in basic_coverage_blocks. iter_enumerated ( ) {
676
676
for & successor in & basic_coverage_blocks. successors [ bcb] {
677
- if basic_coverage_blocks. is_dominated_by ( bcb , successor ) {
677
+ if basic_coverage_blocks. dominates ( successor , bcb ) {
678
678
let loop_header = successor;
679
679
let backedge_from_bcb = bcb;
680
680
debug ! (
0 commit comments