pub trait ExecutionEngine<'a>: 'a + Sized + DisposeRefwhere
    LLVMExecutionEngineRef: From<&'a Self>,
{ type Options: Copy; fn new(
        module: &'a Module,
        options: Self::Options
    ) -> Result<CSemiBox<'a, Self>, CBox<str>>; fn add_module(&'a self, module: &'a Module) { ... } fn remove_module(&'a self, module: &'a Module) -> &'a Module { ... } fn run_static_constructors(&'a self) { ... } fn run_static_destructors(&'a self) { ... } fn find_function(&'a self, name: &str) -> Option<&'a Function> { ... } fn run_function(
        &'a self,
        function: &'a Function,
        args: &[&'a GenericValue]
    ) -> &'a GenericValue { ... } unsafe fn get_global<T>(&'a self, global: &'a Value) -> &'a T { ... } unsafe fn find_global<T>(&'a self, name: &str) -> Option<&'a T> { ... } }
Expand description

An abstract interface for implementation execution of LLVM modules.

This is designed to support both interpreter and just-in-time (JIT) compiler implementations.

Required Associated Types§

The options given to the engine upon creation.

Required Methods§

Create a new execution engine with the given Module and optiions, or return a description of the error.

Provided Methods§

Add a module to the list of modules to interpret or compile.

Remove a module from the list of modules to interpret or compile.

Execute all of the static constructors for this program.

Execute all of the static destructors for this program.

Attempt to find a function with the name given, or None if there wasn’t a function with that name.

Run function with the arguments given as ``GenericValue`s, then return the result as one.

Note that if this engine is a JitEngine, it only supports a small fraction of combinations for the arguments and return value, so be warned.

To convert the arguments to GenericValues, you should use the GenericValueCast::to_generic method. To convert the return value from a GenericValue, you should use the GenericValueCast::from_generic method.

Returns a pointer to the global value given.

This is marked as unsafe because the type cannot be guranteed to be the same as the type of the global value at this point.

Returns a pointer to the global value with the name given.

This is marked as unsafe because the type cannot be guranteed to be the same as the type of the global value at this point.

Implementors§