Returns whether block `a` dominates block `b`. This should return true if `a == b`.
(&self, a: Block, mut b: Block)
| 648 | /// |
| 649 | /// This should return true if `a == b`. |
| 650 | fn block_dominates(&self, a: Block, mut b: Block) -> bool { |
| 651 | // Walk b up the dominator tree until a is reached or we go past it. |
| 652 | // This works because the block ordering is required to be topologically |
| 653 | // ordered with regards to the dominator tree. |
| 654 | while a < b { |
| 655 | match self.block_immediate_dominator(b) { |
| 656 | Some(idom) => b = idom, |
| 657 | None => return false, |
| 658 | } |
| 659 | } |
| 660 | a == b |
| 661 | } |
| 662 | |
| 663 | /// Get the block parameters for a given block. |
| 664 | /// |
no test coverage detected