pub enum Constant {
Null,
Undef,
Integer(i64),
Float(u64),
Aggregate(Vec<ValueId>),
Data(Vec<u64>),
String(Vec<u8>),
Gep {
base: ValueId,
indices: Vec<ValueId>,
},
Cast {
op: CastOp,
value: ValueId,
},
Binary {
op: BinaryOp,
lhs: ValueId,
rhs: ValueId,
},
}Expand description
A module-level constant.
Variants§
Null
The null value of the constant’s type (zero).
Undef
An undefined value.
Integer(i64)
An integer’s bits, sign-extended from its width.
Float(u64)
A float’s bits (half, float or double by its type).
Aggregate(Vec<ValueId>)
An array, structure or vector of other constants (value ids).
Data(Vec<u64>)
A constant array or vector of numbers, as stored (the bits of each element).
String(Vec<u8>)
A string constant, as stored.
Gep
A constant getelementptr: the base (a global) and its indices (module constants).
Cast
A constant cast of a module value (to the type of the constant).
Binary
A constant binary operation on module values.
Trait Implementations§
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnsafeUnpin for Constant
impl UnwindSafe for Constant
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