pub enum Datum {
Zero(u64),
Bytes(ByteRange),
Scalar {
ty: Type,
value: Idx<Imm>,
},
Addr(Idx<Reloc>),
}Expand description
One piece of a global’s initial image.
Sixteen bytes, so an initializer built out of them is a flat array and a table of a million bytes is one of these rather than a million.
Variants§
Zero(u64)
That many zero bytes. What .bss is made of, and what the tail of a partly
initialized array is.
Bytes(ByteRange)
Those literal bytes, from the module’s byte pool. String literals and anything the frontend has already laid out.
Scalar
One scalar of that IR type, from the module’s immediate pool. An integer holds its value and a float holds its bit pattern, both target-independently: which byte comes first is decided by the datalayout when the object file is written, not here.
Fields
Addr(Idx<Reloc>)
The address of another symbol, from the module’s relocation pool. &x in an
initializer, which the linker fills in.
Implementations§
Trait Implementations§
impl Copy for Datum
impl Eq for Datum
impl StructuralPartialEq for Datum
Auto Trait Implementations§
impl Freeze for Datum
impl RefUnwindSafe for Datum
impl Send for Datum
impl Sync for Datum
impl Unpin for Datum
impl UnsafeUnpin for Datum
impl UnwindSafe for Datum
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