Struct LLJIT

Source
pub struct LLJIT {
    jit: LLVMOrcLLJITRef,
}
Expand description

An ORC JIT.

Manages the memory of all JIT’d code and all modules that are transferred to it.

See the ORCv2 docs.

Fields§

§jit: LLVMOrcLLJITRef

Implementations§

Source§

impl LLJIT

Source

pub fn builder() -> LLJITBuilder

Creates a new LLJIT builder.

Source

pub fn new() -> Result<Self, LLVMString>

Creates a new ORC JIT with a target machine for the host.

Source

pub fn new_empty() -> Result<Self, LLVMString>

Creates a new default ORC JIT.

Source

pub unsafe fn from_inner(jit: LLVMOrcLLJITRef) -> Self

Wraps a raw pointer.

Source

pub fn as_inner(&self) -> LLVMOrcLLJITRef

Unwraps the raw pointer.

Source

pub fn get_triple_string(&self) -> &CStr

Return the target triple for this LLJIT instance.

Source

pub fn get_data_layout_string(&self) -> &CStr

Return the data layout for this LLJIT instance.

Source

pub fn get_global_prefix(&self) -> c_char

Returns the global prefix character according to the LLJIT’s DataLayout.

Source

pub fn add_module(&self, tsm: ThreadSafeModule) -> Result<(), LLVMString>

Add an IR module to the main JITDylib.

Source

pub fn add_module_with_dylib( &self, tsm: ThreadSafeModule, jd: JITDylibRef, ) -> Result<(), LLVMString>

Add an IR module to the given JITDylib.

Source

pub fn add_module_with_rt( &self, tsm: ThreadSafeModule, jd: ResourceTracker, ) -> Result<(), LLVMString>

Add an IR module to the given ResourceTracker’s JITDylib.

Source

pub fn get_execution_session(&self) -> ExecutionSessionRef<'_>

Gets the execution session.

Source

pub fn get_main_jit_dylib(&self) -> JITDylibRef

Return a reference to the Main JITDylib.

Source

pub fn mangle_and_intern(&self, unmangled_name: &CStr) -> SymbolStringPoolEntry

Mangles the given string according to the LLJIT instance’s DataLayout, then interns the result in the SymbolStringPool and returns a reference to the pool entry.

Source

pub fn lookup(&self, name: &CStr) -> Result<usize, LLVMString>

Look up the given symbol in the main JITDylib of the given LLJIT instance.

Source

pub fn lookup_unmangled( &self, unmangled_name: &CStr, ) -> Result<usize, LLVMString>

Look up the given symbol in the main JITDylib of the given LLJIT instance.

The name should be mangled.

Source

pub fn get_ir_transform_layer(&self) -> IRTransformLayerRef

Returns a non-owning reference to the LLJIT instance’s IR transform layer.

Trait Implementations§

Source§

impl Drop for LLJIT

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for LLJIT

§

impl RefUnwindSafe for LLJIT

§

impl !Send for LLJIT

§

impl !Sync for LLJIT

§

impl Unpin for LLJIT

§

impl UnwindSafe for LLJIT

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 8 bytes