Replace the instruction under the cursor with `new_inst`. The cursor is left pointing at the new instruction. The old instruction that was replaced is returned.
(&mut self, new_inst: ir::Inst)
| 571 | /// |
| 572 | /// The old instruction that was replaced is returned. |
| 573 | fn replace_inst(&mut self, new_inst: ir::Inst) -> ir::Inst { |
| 574 | let prev_inst = self.remove_inst(); |
| 575 | self.insert_inst(new_inst); |
| 576 | prev_inst |
| 577 | } |
| 578 | |
| 579 | /// Insert a block at the current position and switch to it. |
| 580 | /// |
no test coverage detected