Struct cranelift_codegen::ir::entities::GlobalValue
source · [−]pub struct GlobalValue(_);
Expand description
An opaque reference to a global value.
A GlobalValue
is a Value
that will be live across the entire
function lifetime. It can be preloaded from other global values.
You can create a GlobalValue
in the following ways:
- When compiling to WASM, you can use it to load values from a
VmContext
usingFuncEnvironment::make_global
. - When compiling to native code, you can use it for objects in static memory with
Module::declare_data_in_func
. - For any compilation target, it can be registered with
FunctionBuilder::create_global_value
.
GlobalValue
s can be retrieved with
InstBuilder:global_value
.
While the order is stable, it is arbitrary.
Implementations
sourceimpl GlobalValue
impl GlobalValue
sourceimpl GlobalValue
impl GlobalValue
sourcepub fn with_number(n: u32) -> Option<Self>
pub fn with_number(n: u32) -> Option<Self>
Create a new global value reference from its number.
This method is for use by the parser.
Trait Implementations
sourceimpl Clone for GlobalValue
impl Clone for GlobalValue
sourcefn clone(&self) -> GlobalValue
fn clone(&self) -> GlobalValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GlobalValue
impl Debug for GlobalValue
sourceimpl Display for GlobalValue
impl Display for GlobalValue
sourceimpl EntityRef for GlobalValue
impl EntityRef for GlobalValue
sourceimpl From<GlobalValue> for AnyEntity
impl From<GlobalValue> for AnyEntity
sourcefn from(r: GlobalValue) -> Self
fn from(r: GlobalValue) -> Self
Converts to this type from the input type.
sourceimpl Hash for GlobalValue
impl Hash for GlobalValue
sourceimpl Ord for GlobalValue
impl Ord for GlobalValue
sourceimpl PartialEq<GlobalValue> for GlobalValue
impl PartialEq<GlobalValue> for GlobalValue
sourcefn eq(&self, other: &GlobalValue) -> bool
fn eq(&self, other: &GlobalValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GlobalValue) -> bool
fn ne(&self, other: &GlobalValue) -> bool
This method tests for !=
.
sourceimpl PartialOrd<GlobalValue> for GlobalValue
impl PartialOrd<GlobalValue> for GlobalValue
sourcefn partial_cmp(&self, other: &GlobalValue) -> Option<Ordering>
fn partial_cmp(&self, other: &GlobalValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ReservedValue for GlobalValue
impl ReservedValue for GlobalValue
sourcefn reserved_value() -> GlobalValue
fn reserved_value() -> GlobalValue
Create an instance of the reserved value.
sourcefn is_reserved_value(&self) -> bool
fn is_reserved_value(&self) -> bool
Checks whether value is the reserved one.
impl Copy for GlobalValue
impl Eq for GlobalValue
impl StructuralEq for GlobalValue
impl StructuralPartialEq for GlobalValue
Auto Trait Implementations
impl RefUnwindSafe for GlobalValue
impl Send for GlobalValue
impl Sync for GlobalValue
impl Unpin for GlobalValue
impl UnwindSafe for GlobalValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.