Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
interop.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_INTEROP_H_
8#define LOOMC_INTEROP_H_
9
10#include "loom/error/renderer.h"
11#include "loom/error/source.h"
12#include "loom/ir/module.h"
13#include "loom/pass/registry.h"
14#include "loom/pass/report.h"
15#include "loom/target/pipeline.h"
16#include "loom/target/provider.h"
17#include "loom/target/reporting/report.h"
18#include "loomc/compile.h"
19#include "loomc/module.h"
20#include "loomc/pass.h"
21#include "loomc/result.h"
22#include "loomc/target.h"
23
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
44 const loom_module_t* module;
45
47 const loom_source_table_resolver_t* source_table;
48
54 loom_type_formatter_t type_formatter;
56
69 loom_module_t* module;
70
72 const loom_source_table_resolver_t* source_table;
74
96 const loom_target_provider_set_t* provider_set, loomc_allocator_t allocator,
97 loomc_target_environment_t** out_target_environment);
98
117 const loomc_target_environment_t* target_environment,
118 loom_pass_registry_storage_t* out_storage);
119
150
181
206 loomc_module_t* module, loomc_allocator_t allocator,
207 loomc_module_interop_view_t* out_view, loomc_result_t** out_result);
208
224
232LOOMC_API_EXPORT const loom_target_environment_t*
234 const loomc_target_environment_t* target_environment);
235
243LOOMC_API_EXPORT const loom_target_profile_t*
245 const loomc_target_profile_t* target_profile);
246
258LOOMC_API_EXPORT const loom_target_provider_t*
260 const loomc_target_profile_t* target_profile);
261
262#ifdef __cplusplus
263} // extern "C"
264#endif
265
266#endif // LOOMC_INTEROP_H_
#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
Prepared compilers and module compilation.
loomc_status_t loomc_target_environment_create_from_provider_set(const loom_target_provider_set_t *provider_set, loomc_allocator_t allocator, loomc_target_environment_t **out_target_environment)
Creates a public target environment from exact-version native providers.
loomc_module_mutable_interop_view_t loomc_module_get_mutable_interop_view(loomc_module_t *module)
Projects a mutable native view after invalidating derived module state.
const loom_target_profile_t * loomc_target_profile_get_interop_view(const loomc_target_profile_t *target_profile)
Returns the immutable native profile owned by a public target handle.
loomc_status_t loomc_target_environment_get_native_pass_registry(const loomc_target_environment_t *target_environment, loom_pass_registry_storage_t *out_storage)
Composes builtin and target pass descriptors for exact-version inspection.
const loom_target_provider_t * loomc_target_profile_get_provider_interop_view(const loomc_target_profile_t *target_profile)
Returns the immutable native provider resolved when the profile was created.
const loom_target_environment_t * loomc_target_environment_get_interop_view(const loomc_target_environment_t *target_environment)
Returns the immutable native environment owned by a public target handle.
loomc_status_t loomc_module_get_interop_view(loomc_module_t *module, loomc_allocator_t allocator, loomc_module_interop_view_t *out_view, loomc_result_t **out_result)
Verifies a public module and projects its native read-only view.
Opaque in-memory Loom modules.
struct loomc_module_t loomc_module_t
Opaque parsed, linked, optimized, or lowered module.
Definition module.h:90
Prepared pass programs.
Shared operation result container.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:71
Host allocator used for persistent Loom object storage.
Definition base.h:426
Read-only native projection of a structurally verified LoomC module.
Definition interop.h:42
const loom_source_table_resolver_t * source_table
Exact source snapshots indexed by native module source ID.
Definition interop.h:47
loom_type_formatter_t type_formatter
Formats native types using the module's strings and descriptors without requiring consumers to link t...
Definition interop.h:54
const loom_module_t * module
Native module owned by the public module handle.
Definition interop.h:44
Mutable native projection of a LoomC module for exact-version producers.
Definition interop.h:67
loom_module_t * module
Mutable native module owned by the public module handle.
Definition interop.h:69
const loom_source_table_resolver_t * source_table
Exact source snapshots indexed by native module source ID.
Definition interop.h:72
Collects target compilation details during prepared execution.
Definition interop.h:168
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition interop.h:173
const void * next
Next invocation option extension.
Definition interop.h:176
loom_target_compile_report_t * report
Initialized caller-owned collector. Must not be NULL.
Definition interop.h:179
loomc_structure_type_t type
Must be LOOMC_STRUCTURE_TYPE_NATIVE_COMPILE_REPORT_OPTIONS.
Definition interop.h:170
Collects native pass invocation records during prepared execution.
Definition interop.h:137
const void * next
Next invocation option extension.
Definition interop.h:145
loom_pass_report_t * report
Initialized caller-owned collector. Must not be NULL.
Definition interop.h:148
loomc_structure_type_t type
Must be LOOMC_STRUCTURE_TYPE_NATIVE_PASS_REPORT_OPTIONS.
Definition interop.h:139
loomc_host_size_t structure_size
Size of this structure in bytes.
Definition interop.h:142
Prepared target environments and target lowering pipelines.
struct loomc_target_environment_t loomc_target_environment_t
Prepared immutable target environment.
Definition target.h:124
struct loomc_target_profile_t loomc_target_profile_t
Prepared immutable target profile.
Definition target.h:136