pub struct Label(pub u32);Expand description
A jump target: a position in a program’s op stream that a control-flow op transfers to.
Each basic block of the source function becomes a label, numbered by block index, so
the entry block is always Label(0). Laying out a two-way branch
needs one extra position for the second arm, so a backend appends a few internal
labels past the block labels. Resolve a label to an op index with
Program::label_offset.
§Examples
use codegen_lang::Label;
assert_eq!(Label(0).to_string(), "L0");
assert_eq!(Label(3).to_string(), "L3");Tuple Fields§
§0: u32Trait Implementations§
impl Copy for Label
Source§impl<'de> Deserialize<'de> for Label
impl<'de> Deserialize<'de> for Label
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Label
Source§impl Ord for Label
impl Ord for Label
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Label
impl PartialOrd for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnsafeUnpin for Label
impl UnwindSafe for Label
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more