Optional header-only adapters between IREE base types and the Loom C API.
This header is for IREE-hosted tools and runtimes that already use IREE base types. Core loomc/*.h headers remain independent from IREE. Including this header verifies ABI compatibility and provides zero-copy conversions for status, string view, byte span, and allocator values.
- Example
- Convert at the IREE/Loom boundary and preserve rich status payloads:
iree_status_t create_source_from_iree(
iree_string_view_t identifier, iree_const_byte_span_t contents,
.identifier = loomc_string_view_from_iree(identifier),
.contents = loomc_byte_span_from_iree(contents),
};
&options, loomc_allocator_from_iree(host_allocator), out_source);
return iree_status_from_loomc(status);
}
@ LOOMC_STRUCTURE_TYPE_SOURCE_OPTIONS
loomc_source_options_t.
Definition base.h:186
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
@ LOOMC_SOURCE_STORAGE_COPY
Source bytes are copied into storage owned by the source.
Definition source.h:100
struct loomc_source_t loomc_source_t
Immutable source handle.
Definition source.h:80
@ LOOMC_SOURCE_FORMAT_TEXT
Textual .loom source.
Definition source.h:88
loomc_status_t loomc_source_create(const loomc_source_options_t *options, loomc_allocator_t allocator, loomc_source_t **out_source)
Creates an immutable source handle.
Source creation options.
Definition source.h:123