Struct cranelift_module::DataContext [−][src]
pub struct DataContext { /* fields omitted */ }
This is to data objects what cranelift_codegen::Context is to functions.
Methods
impl DataContext
[src]
impl DataContext
pub fn new() -> Self
[src]
pub fn new() -> Self
Allocate a new context.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear all data structures in this context.
pub fn define_zeroinit(&mut self, size: usize, writable: Writability)
[src]
pub fn define_zeroinit(&mut self, size: usize, writable: Writability)
Define a zero-initialized object with the given size.
pub fn define(&mut self, contents: Box<[u8]>, writable: Writability)
[src]
pub fn define(&mut self, contents: Box<[u8]>, writable: Writability)
Define an object initialized with the given contents.
TODO: Can we avoid a Box here?
pub fn import_function(&mut self, name: ExternalName) -> FuncRef
[src]
pub fn import_function(&mut self, name: ExternalName) -> FuncRef
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
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)
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
)
Write the address of data
into the data at offset offset
.
pub fn description(&self) -> &DataDescription
[src]
pub fn description(&self) -> &DataDescription
Reference the initializer data.
Auto Trait Implementations
impl Send for DataContext
impl Send for DataContext
impl Sync for DataContext
impl Sync for DataContext