Struct cranelift_codegen::ir::entities::GlobalValue [−][src]
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
impl GlobalValue
[src]
pub fn from_u32(x: u32) -> Self
[src]
Create a new instance from a u32
.
pub fn as_u32(self) -> u32
[src]
Return the underlying index value as a u32
.
impl GlobalValue
[src]
pub fn with_number(n: u32) -> Option<Self>
[src]
Create a new global value reference from its number.
This method is for use by the parser.
Trait Implementations
impl Clone for GlobalValue
[src]
fn clone(&self) -> GlobalValue
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for GlobalValue
[src]
impl Debug for GlobalValue
[src]
impl Display for GlobalValue
[src]
impl EntityRef for GlobalValue
[src]
impl Eq for GlobalValue
[src]
impl From<GlobalValue> for AnyEntity
[src]
fn from(r: GlobalValue) -> Self
[src]
impl Hash for GlobalValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for GlobalValue
[src]
fn cmp(&self, other: &GlobalValue) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<GlobalValue> for GlobalValue
[src]
fn eq(&self, other: &GlobalValue) -> bool
[src]
fn ne(&self, other: &GlobalValue) -> bool
[src]
impl PartialOrd<GlobalValue> for GlobalValue
[src]
fn partial_cmp(&self, other: &GlobalValue) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl ReservedValue for GlobalValue
[src]
fn reserved_value() -> GlobalValue
[src]
fn is_reserved_value(&self) -> bool
[src]
impl StructuralEq for GlobalValue
[src]
impl StructuralPartialEq for GlobalValue
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash,
[src]
T: Hash,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SparseMapValue<T> for T where
T: EntityRef,
[src]
T: EntityRef,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,