Execution
Generic Value
LLVM.GenericValue
— TypeGenericValue
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
.
LLVM.dispose
— Methoddispose(val::GenericValue)
Dispose of the given generic value.
Integer
LLVM.GenericValue
— MethodGenericValue(typ::LLVM.IntegerType, N::Integer)
Create a generic value from an integer of the given type.
LLVM.intwidth
— Functionintwidth(val::GenericValue)
Get the bit width of the integer value stored in the generic value.
Base.convert
— Methodconvert(::Type{<:Integer}, val::GenericValue)
Convert a generic value to an integer of the given type.
Floating Point
LLVM.GenericValue
— MethodGenericValue(typ::LLVM.FloatingPointType, N::AbstractFloat)
Create a generic value from a floating point number of the given type.
Base.convert
— Methodconvert(::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.
Pointer
LLVM.GenericValue
— MethodGenericValue(ptr::Ptr)
Create a generic value from a pointer.
Base.convert
— Methodconvert(::Type{Ptr{T}}, val::GenericValue)
Convert a generic value to a pointer.
MCJIT
LLVM.ExecutionEngine
— TypeLLVM.ExecutionEngine
An execution engine that can run functions in a module.
LLVM.Interpreter
— FunctionInterpreter(mod::Module)
Create an interpreter for the given module.
This object needs to be disposed of using dispose
.
LLVM.JIT
— FunctionJIT(mod::Module)
Create a JIT compiler for the given module.
This object needs to be disposed of using dispose
.
LLVM.dispose
— Methoddispose(engine::ExecutionEngine)
Dispose of the given execution engine.
Base.push!
— Methodpush!(engine::LLVM.ExecutionEngine, mod::Module)
Add another module to the execution engine.
This takes ownership of the module.
Base.delete!
— Methoddelete!(engine::ExecutionEngine, mod::Module)
Remove a module from the execution engine.
Ownership of the module is transferred back to the user.
Base.run
— Methodrun(engine::ExecutionEngine, f::Function, [args::Vector{GenericValue}])
Run the given function with the given arguments in the execution engine.
LLVM.lookup
— Methodlookup(engine::ExecutionEngine, fn::String)
Look up the address of the given function in the execution engine.
LLVM.functions
— Methodfunctions(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.
ORCJIT
LLVM.ThreadSafeContext
— TypeThreadSafeContext
A thread-safe version of Context
.
LLVM.ThreadSafeContext
— MethodThreadSafeContext(; opaque_pointers=nothing)
Create a new thread-safe context. The behavior of opaque_pointers
is the same as in Context
.
This object needs to be disposed of using dispose(::ThreadSafeContext)
.
LLVM.context
— Methodcontext(ts_ctx::ThreadSafeContext)
Obtain the context associated with a thread-safe context.
This is an usafe operation, as the return context can be accessed in a thread-unsafe manner.
LLVM.dispose
— Methoddispose(ctx::ThreadSafeContext)
Dispose of the thread-safe context, releasing all resources associated with it.
LLVM.ThreadSafeModule
— TypeThreadSafeModule
A thread-safe version of LLVM.Module
.
LLVM.ThreadSafeModule
— MethodThreadSafeModule(name::String)
Create a thread-safe module with the given name.
This object needs to be disposed of using dispose(::ThreadSafeModule)
.
LLVM.ThreadSafeModule
— Method(mod::ThreadSafeModule)(f)
Apply f
to the LLVM module contained within mod
, after locking the module and activating its context.
LLVM.dispose
— Methoddispose(mod::ThreadSafeModule)
Dispose of the thread-safe module, releasing all resources associated with it.
LLVM.LLJIT
— TypeLLJIT(::LLJITBuilder)
Creates a LLJIT stack based on the provided builder.
Takes ownership of the provided builder.
LLJIT(;tm::Union{Nothing, TargetMachine})
Use the provided TargetMachine and construct an LLJIT from it.
LLVM.JITDylib
— TypeJITDylib(lljit::LLJIT)
Get the main JITDylib
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.
JITDylib(jljit::JuliaOJIT)
Get the external JITDylib from the Julia JIT
LLVM.lookup
— Methodlookup(lljit::LLJIT, name)
Takes an unmangled symbol names and searches for it in the LLJIT.
LLVM.linkinglayercreator!
— Functionlinkinglayercreator!(builder::LLJITBuilder, creator::ObjectLinkingLayerCreator)
The creator object needs to be rooted by the caller for the lifetime of the builder argument.