7#ifndef LOOMC_ARTIFACT_H_
8#define LOOMC_ARTIFACT_H_
45#define LOOMC_ARTIFACT_FORMAT_LOOM_TEXT "loom-text"
48#define LOOMC_ARTIFACT_FORMAT_LOOM_BYTECODE "loombc"
51#define LOOMC_ARTIFACT_FORMAT_JSON "json"
54typedef enum loomc_artifact_kind_e {
loomc_status_t loomc_artifact_write_to_file(const loomc_artifact_t *artifact, FILE *file)
Writes artifact bytes to an open C FILE*.
loomc_status_t loomc_artifact_create_source(const loomc_artifact_t *artifact, loomc_source_format_t format, loomc_allocator_t allocator, loomc_source_t **out_source)
Creates an immutable source handle from an artifact.
loomc_artifact_kind_t
Artifact category.
Definition artifact.h:54
@ LOOMC_ARTIFACT_KIND_REPORT
Machine-readable report artifact.
Definition artifact.h:62
@ LOOMC_ARTIFACT_KIND_LAUNCH_CONFIG
Compiled kernel launch-configuration program.
Definition artifact.h:68
@ LOOMC_ARTIFACT_KIND_EXECUTABLE
Executable or loadable binary artifact.
Definition artifact.h:56
@ LOOMC_ARTIFACT_KIND_TEXT
Human-readable textual artifact.
Definition artifact.h:59
@ LOOMC_ARTIFACT_KIND_MODULE
Loom module artifact. The format indicates text or bytecode.
Definition artifact.h:65
loomc_status_t loomc_artifact_write_to_path(const loomc_artifact_t *artifact, loomc_string_view_t path, loomc_allocator_t allocator)
Writes artifact bytes to a filesystem path.
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition base.h:34
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
Immutable ref-counted byte sequences.
struct loomc_byte_sequence_t loomc_byte_sequence_t
Immutable logical sequence of bytes stored in one or more segments.
Definition byte_sequence.h:28
Immutable source handles used by parsing, indexing, linking, and compiling.
struct loomc_source_t loomc_source_t
Immutable source handle.
Definition source.h:81
loomc_source_format_t
Source byte format.
Definition source.h:84
Host allocator used for persistent Loom object storage.
Definition base.h:390
Borrowed artifact view owned by a producer-specific result or product.
Definition artifact.h:78
loomc_string_view_t format
Stable format string, such as amdgpu-hsaco, spirv, LOOMC_ARTIFACT_FORMAT_LOOM_TEXT,...
Definition artifact.h:84
loomc_artifact_kind_t kind
Artifact kind.
Definition artifact.h:80
loomc_byte_sequence_t * contents
Immutable artifact bytes.
Definition artifact.h:91
loomc_string_view_t identifier
Human-readable artifact identifier.
Definition artifact.h:87
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63