Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
emit.h
Go to the documentation of this file.
1// Copyright 2026 The IREE Authors
2//
3// Licensed under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
7#ifndef LOOMC_EMIT_H_
8#define LOOMC_EMIT_H_
9
10#include "loomc/artifact.h"
13#include "loomc/module.h"
14#include "loomc/result.h"
15#include "loomc/target.h"
16#include "loomc/workspace.h"
17
78
79#ifdef __cplusplus
80extern "C" {
81#endif
82
84#define LOOMC_EMIT_OPTION_KEY_IDENTIFIER "emit.identifier"
85
87#define LOOMC_EMIT_OPTION_KEY_ARTIFACT_MANIFEST_MODE \
88 "emit.artifact_manifest.mode"
89
91#define LOOMC_EMIT_OPTION_KEY_ARTIFACT_MANIFEST_IDENTIFIER \
92 "emit.artifact_manifest.identifier"
93
95#define LOOMC_EMIT_OPTION_KEY_COMPILE_REPORT_MODE "emit.compile_report.mode"
96
98#define LOOMC_EMIT_OPTION_KEY_COMPILE_REPORT_IDENTIFIER \
99 "emit.compile_report.identifier"
100
103
105typedef enum loomc_emit_artifact_flag_bits_e {
110
139
180 loomc_workspace_t* workspace, loomc_module_t* module,
181 const loomc_emit_options_t* options,
182 loomc_allocator_t allocator, loomc_result_t** out_result);
183
184#ifdef __cplusplus
185} // extern "C"
186#endif
187
188#endif // LOOMC_EMIT_H_
In-memory output artifacts produced by compiler operations.
Artifact manifest emission controls.
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition base.h:34
size_t loomc_host_size_t
Host allocation and container size type.
Definition base.h:45
loomc_structure_type_t
Structure type values used by extensible public descriptors.
Definition base.h:181
struct iree_status_handle_t * loomc_status_t
Opaque status handle.
Definition base.h:55
Compile report emission controls.
loomc_status_t loomc_emit_module(loomc_target_environment_t *target_environment, loomc_workspace_t *workspace, loomc_module_t *module, const loomc_emit_options_t *options, loomc_allocator_t allocator, loomc_result_t **out_result)
Emits target artifacts from a prepared module.
loomc_emit_artifact_flag_bits_t
Emit artifact request flag bits.
Definition emit.h:105
@ LOOMC_EMIT_ARTIFACT_FLAG_PRIMARY
Request the primary loadable artifact.
Definition emit.h:108
uint32_t loomc_emit_artifact_flags_t
Emit artifact request flags.
Definition emit.h:102
Opaque in-memory Loom modules.
struct loomc_module_t loomc_module_t
Opaque parsed, linked, optimized, or lowered module.
Definition module.h:89
Shared operation result container.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:63
Host allocator used for persistent Loom object storage.
Definition base.h:375
Target emission options.
Definition emit.h:118
loomc_structure_type_t type
Structure type. Must be LOOMC_STRUCTURE_TYPE_EMIT_OPTIONS when nonzero.
Definition emit.h:120
const void * next
Extension chain for emission options.
Definition emit.h:126
loomc_emit_artifact_flags_t artifact_flags
Requested artifact classes. Zero requests the primary artifact.
Definition emit.h:137
loomc_string_view_t artifact_format
Artifact format to emit.
Definition emit.h:130
loomc_string_view_t identifier
Artifact identifier for the primary output.
Definition emit.h:134
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition emit.h:123
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63
Prepared target environments and target lowering pipelines.
struct loomc_target_environment_t loomc_target_environment_t
Prepared immutable target environment.
Definition target.h:123
Per-worker scratch workspace.
struct loomc_workspace_t loomc_workspace_t
Mutable per-worker scratch workspace.
Definition workspace.h:54