Allocate a `Label` to refer to some offset. May not be bound to a fixed offset yet.
(&mut self)
| 633 | /// Allocate a `Label` to refer to some offset. May not be bound to a fixed |
| 634 | /// offset yet. |
| 635 | pub fn get_label(&mut self) -> MachLabel { |
| 636 | let l = self.label_offsets.len() as u32; |
| 637 | self.label_offsets.push(UNKNOWN_LABEL_OFFSET); |
| 638 | self.label_aliases.push(UNKNOWN_LABEL); |
| 639 | trace!("MachBuffer: new label -> {:?}", MachLabel(l)); |
| 640 | MachLabel(l) |
| 641 | |
| 642 | // Post-invariant: the only mutation is to add a new label; it has no |
| 643 | // bound offset yet, so it trivially satisfies all invariants. |
| 644 | } |
| 645 | |
| 646 | /// Reserve the first N MachLabels for blocks. |
| 647 | pub fn reserve_labels_for_blocks(&mut self, blocks: usize) { |