Struct melior_next::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_obj_dump: bool
) -> Self
pub fn new( module: &Module<'_>, optimization_level: usize, shared_library_paths: &[&str], enable_obj_dump: bool ) -> Self
Creates an ExecutionEngine for the provided Module.
The Module is expected to be “translatable” to LLVM IR (only contains operations in dialects that implement the LLVMTranslationDialectInterface).
The module ownership stays with the client and can be destroyed as soon as the call returns.
optimization_level is the optimization level to be used for transformation and code generation. LLVM passes at optLevel are run before code generation.
shared_library_paths - The number and array of paths corresponding to shared libraries that will be loaded are specified via numPaths and sharedLibPaths
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.
The function must have been tagged with the llvm.emit_c_interface attribute.
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.