Struct cranelift_codegen::ir::entities::GlobalValue
source · pub struct GlobalValue(/* private fields */);
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§
source§impl GlobalValue
impl GlobalValue
source§impl 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§
source§impl Clone for GlobalValue
impl Clone for GlobalValue
source§fn clone(&self) -> GlobalValue
fn clone(&self) -> GlobalValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GlobalValue
impl Debug for GlobalValue
source§impl Display for GlobalValue
impl Display for GlobalValue
source§impl EntityRef for GlobalValue
impl EntityRef for GlobalValue
source§impl From<GlobalValue> for AnyEntity
impl From<GlobalValue> for AnyEntity
source§fn from(r: GlobalValue) -> Self
fn from(r: GlobalValue) -> Self
Converts to this type from the input type.
source§impl Hash for GlobalValue
impl Hash for GlobalValue
source§impl Ord for GlobalValue
impl Ord for GlobalValue
source§fn cmp(&self, other: &GlobalValue) -> Ordering
fn cmp(&self, other: &GlobalValue) -> Ordering
1.21.0 · 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 PartialEq for GlobalValue
impl PartialEq for GlobalValue
source§fn 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 ==
.source§impl PartialOrd for GlobalValue
impl PartialOrd for GlobalValue
source§fn partial_cmp(&self, other: &GlobalValue) -> Option<Ordering>
fn partial_cmp(&self, other: &GlobalValue) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl ReservedValue for GlobalValue
impl ReservedValue for GlobalValue
source§fn reserved_value() -> GlobalValue
fn reserved_value() -> GlobalValue
Create an instance of the reserved value.
source§fn 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 StructuralPartialEq for GlobalValue
Auto Trait Implementations§
impl Freeze for GlobalValue
impl RefUnwindSafe for GlobalValue
impl Send for GlobalValue
impl Sync for GlobalValue
impl Unpin for GlobalValue
impl UnwindSafe for GlobalValue
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.