Struct cranelift_module::DataContext [−][src]
pub struct DataContext { /* fields omitted */ }Expand description
This is to data objects what cranelift_codegen::Context is to functions.
Implementations
impl DataContext[src]
impl DataContext[src]pub fn define_zeroinit(&mut self, size: usize)[src]
pub fn define_zeroinit(&mut self, size: usize)[src]Define a zero-initialized object with the given size.
pub fn define(&mut self, contents: Box<[u8]>)[src]
pub fn define(&mut self, contents: Box<[u8]>)[src]Define an object initialized with the given contents.
TODO: Can we avoid a Box here?
pub fn set_segment_section(&mut self, seg: &str, sec: &str)[src]
pub fn set_segment_section(&mut self, seg: &str, sec: &str)[src]Override the segment/section for data, only supported on Object backend
pub fn set_align(&mut self, align: u64)[src]
pub fn set_align(&mut self, align: u64)[src]Set the alignment for data. The alignment must be a power of two.
pub fn import_function(&mut self, name: ExternalName) -> FuncRef[src]
pub fn import_function(&mut self, name: ExternalName) -> FuncRef[src]Declare an external function import.
Users of the Module API generally should call
Module::declare_func_in_data instead, as it takes care of generating
the appropriate ExternalName.
pub fn import_global_value(&mut self, name: ExternalName) -> GlobalValue[src]
pub fn import_global_value(&mut self, name: ExternalName) -> GlobalValue[src]Declares a global value import.
TODO: Rename to import_data?
Users of the Module API generally should call
Module::declare_data_in_data instead, as it takes care of generating
the appropriate ExternalName.
pub fn write_function_addr(&mut self, offset: CodeOffset, func: FuncRef)[src]
pub fn write_function_addr(&mut self, offset: CodeOffset, func: FuncRef)[src]Write the address of func into the data at offset offset.
pub fn write_data_addr(
&mut self,
offset: CodeOffset,
data: GlobalValue,
addend: Addend
)[src]
pub fn write_data_addr(
&mut self,
offset: CodeOffset,
data: GlobalValue,
addend: Addend
)[src]Write the address of data into the data at offset offset.
pub fn description(&self) -> &DataDescription[src]
pub fn description(&self) -> &DataDescription[src]Reference the initializer data.