Enum cranelift_codegen::ir::GlobalValueData
source · pub enum GlobalValueData {
VMContext,
Load {
base: GlobalValue,
offset: Offset32,
global_type: Type,
readonly: bool,
},
IAddImm {
base: GlobalValue,
offset: Imm64,
global_type: Type,
},
Symbol {
name: ExternalName,
offset: Imm64,
colocated: bool,
},
}
Expand description
Information about a global value declaration.
Variants§
VMContext
Value is the address of the VM context struct.
Load
Fields
base: GlobalValue
The base pointer global value.
Value is pointed to by another global value.
The base
global value is assumed to contain a pointer. This global value is computed
by loading from memory at that pointer value. The memory must be accessible, and
naturally aligned to hold a value of the type. The data at this address is assumed
to never change while the current function is executing.
IAddImm
Fields
base: GlobalValue
The base pointer global value.
Value is an offset from another global value.
Symbol
Fields
name: ExternalName
The symbolic name.
Value is symbolic, meaning it’s a name which will be resolved to an actual value later (eg. by linking). Cranelift itself does not interpret this name; it’s used by embedders to link with other data structures.
For now, symbolic values always have pointer type, and represent addresses, however in the future they could be used to represent other things as well.
Implementations§
source§impl GlobalValueData
impl GlobalValueData
sourcepub fn symbol_name(&self) -> &ExternalName
pub fn symbol_name(&self) -> &ExternalName
Assume that self
is an GlobalValueData::Symbol
and return its name.
sourcepub fn global_type(&self, isa: &dyn TargetIsa) -> Type
pub fn global_type(&self, isa: &dyn TargetIsa) -> Type
Return the type of this global.
Trait Implementations§
source§impl Clone for GlobalValueData
impl Clone for GlobalValueData
source§fn clone(&self) -> GlobalValueData
fn clone(&self) -> GlobalValueData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more