Insert an instruction at the current position. - If pointing at an instruction, the new instruction is inserted before the current instruction. - If pointing at the bottom of a block, the new instruction is appended to the block. - Otherwise panic. In either case, the cursor is not moved, such that repeated calls to `insert_inst()` causes instructions to appear in insertion order in the block.
(&mut self, inst: ir::Inst)
| 533 | /// In either case, the cursor is not moved, such that repeated calls to `insert_inst()` causes |
| 534 | /// instructions to appear in insertion order in the block. |
| 535 | fn insert_inst(&mut self, inst: ir::Inst) { |
| 536 | use self::CursorPosition::*; |
| 537 | match self.position() { |
| 538 | Nowhere | Before(..) => panic!("Invalid insert_inst position"), |
| 539 | At(cur) => self.layout_mut().insert_inst(inst, cur), |
| 540 | After(block) => self.layout_mut().append_inst(inst, block), |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | /// Remove the instruction under the cursor. |
| 545 | /// |
no test coverage detected