Make sure that the current block is inserted in the layout.
(&mut self)
| 609 | |
| 610 | /// Make sure that the current block is inserted in the layout. |
| 611 | pub fn ensure_inserted_block(&mut self) { |
| 612 | let block = self.position.unwrap(); |
| 613 | if self.is_pristine(block) { |
| 614 | if !self.func.layout.is_block_inserted(block) { |
| 615 | self.func.layout.append_block(block); |
| 616 | } |
| 617 | self.func_ctx.status[block] = BlockStatus::Partial; |
| 618 | } else { |
| 619 | debug_assert!( |
| 620 | !self.is_filled(block), |
| 621 | "you cannot add an instruction to a block already filled" |
| 622 | ); |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | /// Returns a [`FuncCursor`] pointed at the current position ready for inserting instructions. |
| 627 | /// |
no test coverage detected