Execution

Generic Value

LLVM.GenericValueType
GenericValue

A generic value that can be passed to or returned from a function in the execution engine.

Note that only simple types are supported, and for most use cases it is recommended to look up the address of the compiled function and ccall it directly.

This object needs to be disposed of using dispose.

source
LLVM.disposeMethod
dispose(val::GenericValue)

Dispose of the given generic value.

source

Integer

LLVM.GenericValueMethod
GenericValue(typ::LLVM.IntegerType, N::Integer)

Create a generic value from an integer of the given type.

source
LLVM.intwidthFunction
intwidth(val::GenericValue)

Get the bit width of the integer value stored in the generic value.

source
Base.convertMethod
convert(::Type{<:Integer}, val::GenericValue)

Convert a generic value to an integer of the given type.

source

Floating Point

LLVM.GenericValueMethod
GenericValue(typ::LLVM.FloatingPointType, N::AbstractFloat)

Create a generic value from a floating point number of the given type.

source
Base.convertMethod
convert(::Type{<:AbstractFloat}, val::GenericValue, typ::LLVM.FloatingPointType)

Convert a generic value to a floating point number of the given type.

Contrary to the integer conversion, the LLVM type is also required to be passed explicitly.

source

Pointer

Base.convertMethod
convert(::Type{Ptr{T}}, val::GenericValue)

Convert a generic value to a pointer.

source

MCJIT

LLVM.InterpreterFunction
Interpreter(mod::Module)

Create an interpreter for the given module.

This object needs to be disposed of using dispose.

source
LLVM.JITFunction
JIT(mod::Module)

Create a JIT compiler for the given module.

This object needs to be disposed of using dispose.

source
LLVM.disposeMethod
dispose(engine::ExecutionEngine)

Dispose of the given execution engine.

source
Base.push!Method
push!(engine::LLVM.ExecutionEngine, mod::Module)

Add another module to the execution engine.

This takes ownership of the module.

source
Base.delete!Method
delete!(engine::ExecutionEngine, mod::Module)

Remove a module from the execution engine.

Ownership of the module is transferred back to the user.

source
Base.runMethod
run(engine::ExecutionEngine, f::Function, [args::Vector{GenericValue}])

Run the given function with the given arguments in the execution engine.

source
LLVM.lookupMethod
lookup(engine::ExecutionEngine, fn::String)

Look up the address of the given function in the execution engine.

source
LLVM.functionsMethod
functions(engine::ExecutionEngine)

Get an iterator over the functions in the execution engine.

The iterator object is not actually iterable, but supports get and haskey queries with function names, and getindex to get the function object.

source

ORCJIT

LLVM.contextMethod
context(ts_ctx::ThreadSafeContext)

Obtain the context associated with a thread-safe context.

Warning

This is an usafe operation, as the return context can be accessed in a thread-unsafe manner.

source
LLVM.disposeMethod
dispose(ctx::ThreadSafeContext)

Dispose of the thread-safe context, releasing all resources associated with it.

source
LLVM.ThreadSafeModuleMethod
(mod::ThreadSafeModule)(f)

Apply f to the LLVM module contained within mod, after locking the module and activating its context.

source
LLVM.disposeMethod
dispose(mod::ThreadSafeModule)

Dispose of the thread-safe module, releasing all resources associated with it.

source
LLVM.LLJITType
LLJIT(::LLJITBuilder)

Creates a LLJIT stack based on the provided builder.

Note

Takes ownership of the provided builder.

source
LLJIT(;tm::Union{Nothing, TargetMachine})

Use the provided TargetMachine and construct an LLJIT from it.

source
LLVM.JITDylibType
JITDylib(lljit::LLJIT)

Get the main JITDylib

source
JITDylib(es::ExecutionSession, name; bare=false)

Adds a new JITDylib to the ExecutionSession. The name must be unique and the bare=true no standard platform symbols are made available.

source
JITDylib(jljit::JuliaOJIT)

Get the external JITDylib from the Julia JIT

source
LLVM.lookupMethod
lookup(lljit::LLJIT, name)

Takes an unmangled symbol names and searches for it in the LLJIT.

source
LLVM.linkinglayercreator!Function
linkinglayercreator!(builder::LLJITBuilder, creator::ObjectLinkingLayerCreator)
Warning

The creator object needs to be rooted by the caller for the lifetime of the builder argument.

source