[−][src]Struct cranelift_codegen::ir::entities::GlobalValue
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
.
Methods
impl GlobalValue
pub fn from_u32(x: u32) -> Self
Return the underlying index value as a u32
.
pub fn as_u32(self) -> u32
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 From<GlobalValue> for AnyEntity
[src]
fn from(r: GlobalValue) -> Self
[src]
impl PartialEq<GlobalValue> for GlobalValue
[src]
fn eq(&self, other: &GlobalValue) -> bool
[src]
fn ne(&self, other: &GlobalValue) -> bool
[src]
impl Eq for GlobalValue
[src]
impl Hash for GlobalValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Debug for GlobalValue
impl Display for GlobalValue
impl Copy for GlobalValue
[src]
impl Clone for GlobalValue
[src]
fn clone(&self) -> GlobalValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl ReservedValue for GlobalValue
fn reserved_value() -> GlobalValue
impl EntityRef for GlobalValue
Auto Trait Implementations
impl Unpin for GlobalValue
impl Send for GlobalValue
impl Sync for GlobalValue
impl UnwindSafe for GlobalValue
impl RefUnwindSafe for GlobalValue
Blanket Implementations
impl<T> From<T> for T
[src]
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> SparseMapValue<T> for T where
T: EntityRef,
[src]
T: EntityRef,