[−][src]Struct cranelift_module::DataContext
This is to data objects what cranelift_codegen::Context is to functions.
Implementations
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)
[src]
Define a zero-initialized object with the given size.
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]
Override the segment/section for data, only supported on Object backend
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]
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]
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]
&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]
Reference the initializer data.
Auto Trait Implementations
impl RefUnwindSafe for DataContext
impl Send for DataContext
impl Sync for DataContext
impl Unpin for DataContext
impl UnwindSafe for DataContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,