Rewrite the branch destination to `new_dest` if the destination matches `old_dest`. Does nothing if called with a non-jump or non-branch instruction.
(&mut self, inst: Inst, old_dest: Block, new_dest: Block)
| 295 | /// Rewrite the branch destination to `new_dest` if the destination matches `old_dest`. |
| 296 | /// Does nothing if called with a non-jump or non-branch instruction. |
| 297 | pub fn rewrite_branch_destination(&mut self, inst: Inst, old_dest: Block, new_dest: Block) { |
| 298 | for dest in self.dfg.insts[inst] |
| 299 | .branch_destination_mut(&mut self.dfg.jump_tables, &mut self.dfg.exception_tables) |
| 300 | { |
| 301 | if dest.block(&self.dfg.value_lists) == old_dest { |
| 302 | dest.set_block(new_dest, &mut self.dfg.value_lists) |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | /// Checks that the specified block can be encoded as a basic block. |
| 308 | /// |
nothing calls this directly
no test coverage detected