Struct melior::ExecutionEngine
source · pub struct ExecutionEngine { /* private fields */ }
Expand description
An execution engine.
Implementations§
source§impl ExecutionEngine
impl ExecutionEngine
sourcepub fn new(
module: &Module<'_>,
optimization_level: usize,
shared_library_paths: &[&str],
enable_object_dump: bool
) -> Self
pub fn new( module: &Module<'_>, optimization_level: usize, shared_library_paths: &[&str], enable_object_dump: bool ) -> Self
Creates an execution engine.
sourcepub fn lookup(&self, name: &str) -> *mut ()
pub fn lookup(&self, name: &str) -> *mut ()
Searches a symbol in a module and returns a pointer to it.
sourcepub unsafe fn invoke_packed(
&self,
name: &str,
arguments: &mut [*mut ()]
) -> Result<(), Error>
pub unsafe fn invoke_packed( &self, name: &str, arguments: &mut [*mut ()] ) -> Result<(), Error>
Invokes a function in a module. The arguments
argument includes
pointers to results of the function as well as arguments.
Safety
This function modifies memory locations pointed by the arguments
argument. If those pointers are invalid or misaligned, calling this
function might result in undefined behavior.
sourcepub unsafe fn register_symbol(&self, name: &str, ptr: *mut ())
pub unsafe fn register_symbol(&self, name: &str, ptr: *mut ())
Register a symbol. This symbol will be accessible to the JIT’d codes.
Safety
This function makes a pointer accessible to the execution engine. If a given pointer is invalid or misaligned, calling this function might result in undefined behavior.
sourcepub fn dump_to_object_file(&self, path: &str)
pub fn dump_to_object_file(&self, path: &str)
Dumps a module to an object file.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ExecutionEngine
impl !Send for ExecutionEngine
impl !Sync for ExecutionEngine
impl Unpin for ExecutionEngine
impl UnwindSafe for ExecutionEngine
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more