118[[gnu::nonnull(1, 2, 3)]]
128[[gnu::nonnull(1, 2, 3)]]
139[[gnu::nonnull(1, 2, 3, 4)]]
147[[gnu::nonnull(1, 2)]]
156[[gnu::nonnull(1, 2, 3, 4)]]
163[[gnu::nonnull(1, 2, 3)]]
Error handling for the runtime.
srn_jit_t * srn_jit_create(srn_mm_t *mm, const srn_jit_config_t *config)
Create a JIT engine backed by a fresh ORC session, allocating from mm.
srn_error_t * srn_jit_add_bitcode(srn_jit_t *jit, srn_context_t *ctx, const void *buf, size_t len, srn_jit_module_t **out)
Add the LLVM bitcode in buf (of length len) to jit for compilation.
struct srn_jit_t srn_jit_t
An opaque handle to a live JIT engine, owning the underlying llvm orc session.
const char * srn_jit_data_layout(srn_jit_t *jit)
The target data-layout string the JIT compiles against.
const char * srn_jit_triple(srn_jit_t *jit)
The target triple the JIT compiles for.
srn_error_t * srn_jit_lookup(srn_jit_t *jit, srn_context_t *ctx, const char *name, void **out_addr)
Look up the compiled symbol name, forcing its module to compile if it has not already,...
void srn_jit_destroy(srn_jit_t *jit)
Destroy jit, tearing down its ORC session and releasing every module it still holds.
srn_error_t * srn_jit_remove(srn_jit_t *jit, srn_context_t *ctx, srn_jit_module_t *module)
Unload module from jit, removing the symbols it defined and freeing the code it compiled.
srn_error_t * srn_jit_expose_process_symbols(srn_jit_t *jit, srn_context_t *ctx)
Make the symbols already linked into the running process resolvable from generated code,...
srn_error_t * srn_jit_define(srn_jit_t *jit, srn_context_t *ctx, const char *name, void *addr)
Define the absolute symbol name in the JIT as resolving to addr, so generated code can call a runtime...
struct srn_jit_module_t srn_jit_module_t
An opaque handle to one unit of code added to the JIT.
struct srn_object_cache_t srn_object_cache_t
An opaque handle to our object cache that utilizes llvm's ObjectCache.
srn_error_t * srn_jit_add_ir(srn_jit_t *jit, srn_context_t *ctx, const char *ir, size_t len, srn_jit_module_t **out)
Parse the textual LLVM IR in ir (of length len) and add it to jit for compilation.
A runtime error, a tag classifying the failure and a human-readable message.
Tuning for a JIT engine, passed to srn_jit_create.
int opt_level
Optimisation level applied to added modules, 0 (none) through 3.
bool install_default_pipeline
When true, the default middle-end optimisation pipeline runs over each module before it is compiled; ...
Main memory manager structure that will own all the allocated blocks and data.