|
| loomc_status_t | loomc_cmd_program_product_build (loomc_workspace_t *workspace, const loomc_cmd_program_product_options_t *options, loomc_allocator_t allocator, loomc_product_t **out_product, loomc_result_t **out_result) |
| | Builds portable command programs and optional kernel source requests.
|
| loomc_status_t | loomc_cmd_program_product_build_request (loomc_context_t *context, loomc_workspace_t *workspace, const loomc_request_t *request, const loomc_cmd_program_request_options_t *options, loomc_allocator_t allocator, loomc_product_t **out_product, loomc_result_t **out_result) |
| | Builds portable command programs from an ordinary bytecode request.
|
| const loomc_product_descriptor_t * | loomc_cmd_program_product_descriptor (void) |
| | Returns the process-local command-product descriptor.
|
| loomc_host_size_t | loomc_cmd_program_product_program_count (const loomc_product_t *product) |
| | Returns the number of serialized command roots in product.
|
| bool | loomc_cmd_program_product_program_at (const loomc_product_t *product, loomc_host_size_t ordinal, loomc_cmd_program_t *out_program) |
| | Returns serialized command-root metadata by product-local ordinal.
|
| loomc_host_size_t | loomc_cmd_program_product_entry_requirement_count (const loomc_product_t *product) |
| | Returns the number of product-wide executable-entry requirements.
|
| bool | loomc_cmd_program_product_entry_requirement_at (const loomc_product_t *product, loomc_host_size_t ordinal, loomc_cmd_entry_requirement_t *out_requirement) |
| | Returns an executable-entry requirement by product-local ordinal.
|
Portable command-program products and independent kernel requests.
Command product construction selects command roots from a reusable frozen link index, lowers their host-side orchestration to portable command bytes, and optionally publishes independently compilable kernel requests. The operation never prints or reparses a module. Exact root ordinals let a high-throughput embedding resolve human-readable names once at ingress and use indexed identity throughout planning.
Without a request sink, construction leaves kernel implementation facets unopened. With a sink, it classifies only surviving source-backed launch sites and publishes one ordinary bytecode request per live semantic class. Published requests transfer independently and are never retained by the product.
- Example
- Build one command product from an already resolved root:
.structure_size = sizeof(options),
.link_index = link_index,
.root_symbol_ordinals = &root_symbol_ordinal,
.root_symbol_count = 1,
};
}
}
loomc_allocator_t loomc_allocator_system(void)
Returns a process-global system allocator.
@ LOOMC_STRUCTURE_TYPE_CMD_PROGRAM_PRODUCT_OPTIONS
loomc_cmd_program_product_options_t.
Definition base.h:288
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
struct loomc_product_t loomc_product_t
Immutable successful compiler product.
Definition product.h:66
void loomc_product_release(loomc_product_t *product)
Releases a product.
loomc_status_t loomc_cmd_program_product_build(loomc_workspace_t *workspace, const loomc_cmd_program_product_options_t *options, loomc_allocator_t allocator, loomc_product_t **out_product, loomc_result_t **out_result)
Builds portable command programs and optional kernel source requests.
bool loomc_cmd_program_product_program_at(const loomc_product_t *product, loomc_host_size_t ordinal, loomc_cmd_program_t *out_program)
Returns serialized command-root metadata by product-local ordinal.
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:64
Command-product construction options.
Definition program.h:82
One serialized command root and its executable-entry projection.
Definition program.h:159
Builds portable command programs and optional kernel source requests.
The returned product has the command descriptor, one executable artifact and exported root per selected command root, and one requirement per product-wide executable-entry binding. Command-specific queries expose the root symbols, root-to-requirement projections, and requirement symbols. The product owns all serialized bytes and copied names and retains no source module, link index, workspace, compiler plan, or analysis state.
- Parameters
-
| workspace | Invocation-local compiler workspace. |
| options | Product selection and specialization options. |
| allocator | Host allocator used for returned product and result state. |
| out_product | Receives one retained product when the result succeeds; receives NULL when the result fails. |
| out_result | Receives one retained result for the operation. |
- Returns
- OK when the operation ran to a result. Non-OK statuses represent structural API misuse, callback failure, or infrastructure failure.
- Ownership
- The caller owns out_product when non-NULL and releases it with loomc_product_release. The caller owns out_result on an OK return and releases it with loomc_result_release. Each request is transferred independently to options->request_sink.
- Lifetime
- The operation borrows options, its arrays, link_index, and workspace synchronously. The returned product and published requests borrow none of them.
- Thread safety
- Calls may share a frozen link index. Each concurrent call requires a distinct workspace. Callback synchronization is owned by the embedding.