Struct cretonne_module::DataContext
[−]
[src]
pub struct DataContext { /* fields omitted */ }
This is to data objects what cretonne_codegen::Context is to functions.
Methods
impl DataContext
[src]
pub fn new() -> Self
[src]
Allocate a new context.
pub fn clear(&mut self)
[src]
Clear all data structures in this context.
pub fn define_zeroinit(&mut self, size: usize, writable: Writability)
[src]
Define a zero-initialized object with the given size.
pub fn define(&mut self, contents: Box<[u8]>, writable: Writability)
[src]
Define a zero-initialized object with the given size.
TODO: Can we avoid a Box here?
pub fn import_function(&mut self, name: ExternalName) -> FuncRef
[src]
Declare an external function import.
pub fn import_global_var(&mut self, name: ExternalName) -> GlobalVar
[src]
Declares a global variable import.
TODO: Rename to import_data?
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: GlobalVar,
addend: Addend
)
[src]
&mut self,
offset: CodeOffset,
data: GlobalVar,
addend: Addend
)
Write the address of data
into the data at offset offset
.
pub fn description(&self) -> &DataDescription
[src]
Reference the initializer data.