Linker and opaque linked-module handles.
Linking resolves primary sources/modules against reusable frozen indexes and produces an opaque module handle that can be consumed by later API operations without printing and reparsing text. The optimized embedding path prepares linkers and indexes once, then invokes them many times with per-worker workspaces.
if (!loomc_status_is_ok(status)) return status;
if (!loomc_status_is_ok(status)) {
return status;
}
loomc_make_cstring_view("@entry"),
};
.link_index = library_index,
.root_symbols = roots,
.root_symbol_count = 1,
};
linker, workspace, &link_options, &module, &result);
}
loomc_allocator_t loomc_allocator_system(void)
Returns a process-global system allocator.
@ LOOMC_STRUCTURE_TYPE_LINK_OPTIONS
loomc_link_options_t.
Definition base.h:201
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
void loomc_linker_release(loomc_linker_t *linker)
Releases a prepared linker from one owner.
struct loomc_linker_t loomc_linker_t
Prepared immutable linker.
Definition link.h:77
loomc_status_t loomc_link_module(loomc_linker_t *linker, loomc_workspace_t *workspace, const loomc_link_options_t *options, loomc_module_t **out_module, loomc_result_t **out_result)
Links a frozen index into an opaque module.
loomc_status_t loomc_linker_create(loomc_context_t *context, const loomc_linker_options_t *options, loomc_allocator_t allocator, loomc_linker_t **out_linker)
Creates a prepared immutable linker.
struct loomc_module_t loomc_module_t
Opaque parsed, linked, optimized, or lowered module.
Definition module.h:89
void loomc_module_release(loomc_module_t *module)
Releases an opaque module from one owner.
void loomc_result_release(loomc_result_t *result)
Releases result from one owner.
bool loomc_result_succeeded(const loomc_result_t *result)
Returns true when result succeeded.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:63
Link invocation options.
Definition link.h:124
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63
loomc_status_t loomc_workspace_create(const loomc_workspace_options_t *options, loomc_allocator_t allocator, loomc_workspace_t **out_workspace)
Creates a mutable workspace for one worker at a time.
void loomc_workspace_release(loomc_workspace_t *workspace)
Releases workspace and all storage it owns.
struct loomc_workspace_t loomc_workspace_t
Mutable per-worker scratch workspace.
Definition workspace.h:54