Loom C API
Public Loom compiler C API
Toggle main menu visibility
Loading...
Searching...
No Matches
result.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_RESULT_H_
8
#define LOOMC_RESULT_H_
9
10
#include "
loomc/artifact.h
"
11
#include "
loomc/diagnostic.h
"
12
54
55
#ifdef __cplusplus
56
extern
"C"
{
57
#endif
58
64
typedef
struct
loomc_result_t
loomc_result_t
;
65
67
typedef
enum
loomc_result_state_e {
69
LOOMC_RESULT_STATE_SUCCEEDED
= 0,
70
72
LOOMC_RESULT_STATE_FAILED
= 1,
73
75
LOOMC_RESULT_STATE_CANCELLED
= 2,
76
}
loomc_result_state_t
;
77
84
LOOMC_API_EXPORT
void
loomc_result_retain
(
loomc_result_t
* result);
85
93
LOOMC_API_EXPORT
void
loomc_result_release
(
loomc_result_t
* result);
94
99
LOOMC_API_EXPORT
loomc_result_state_t
100
loomc_result_state
(
const
loomc_result_t
* result);
101
107
LOOMC_API_EXPORT
bool
loomc_result_succeeded
(
const
loomc_result_t
* result);
108
113
LOOMC_API_EXPORT
loomc_host_size_t
114
loomc_result_diagnostic_count
(
const
loomc_result_t
* result);
115
124
LOOMC_API_EXPORT
const
loomc_diagnostic_t
*
loomc_result_diagnostic_at
(
125
const
loomc_result_t
* result,
loomc_host_size_t
index);
126
131
LOOMC_API_EXPORT
loomc_host_size_t
132
loomc_result_artifact_count
(
const
loomc_result_t
* result);
133
142
LOOMC_API_EXPORT
const
loomc_artifact_t
*
loomc_result_artifact_at
(
143
const
loomc_result_t
* result,
loomc_host_size_t
index);
144
145
#ifdef __cplusplus
146
}
// extern "C"
147
#endif
148
149
#endif
// LOOMC_RESULT_H_
artifact.h
In-memory output artifacts produced by compiler operations.
LOOMC_API_EXPORT
#define LOOMC_API_EXPORT
Exports a public Loom C API symbol from a shared library build.
Definition
base.h:34
loomc_host_size_t
size_t loomc_host_size_t
Host allocation and container size type.
Definition
base.h:45
diagnostic.h
Structured diagnostics produced by completed operations.
loomc_result_release
void loomc_result_release(loomc_result_t *result)
Releases result from one owner.
loomc_result_state_t
loomc_result_state_t
Terminal operation-domain state.
Definition
result.h:67
LOOMC_RESULT_STATE_FAILED
@ LOOMC_RESULT_STATE_FAILED
Operation completed with diagnostics and no infrastructure status failure.
Definition
result.h:72
LOOMC_RESULT_STATE_CANCELLED
@ LOOMC_RESULT_STATE_CANCELLED
Operation completed after observing cancellation.
Definition
result.h:75
LOOMC_RESULT_STATE_SUCCEEDED
@ LOOMC_RESULT_STATE_SUCCEEDED
Operation succeeded and requested outputs are available.
Definition
result.h:69
loomc_result_state
loomc_result_state_t loomc_result_state(const loomc_result_t *result)
Returns the result state.
loomc_result_diagnostic_at
const loomc_diagnostic_t * loomc_result_diagnostic_at(const loomc_result_t *result, loomc_host_size_t index)
Returns a diagnostic by index.
loomc_result_retain
void loomc_result_retain(loomc_result_t *result)
Retains result for another owner.
loomc_result_artifact_at
const loomc_artifact_t * loomc_result_artifact_at(const loomc_result_t *result, loomc_host_size_t index)
Returns an artifact by index.
loomc_result_succeeded
bool loomc_result_succeeded(const loomc_result_t *result)
Returns true when result succeeded.
loomc_result_t
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition
result.h:64
loomc_result_artifact_count
loomc_host_size_t loomc_result_artifact_count(const loomc_result_t *result)
Returns the number of artifacts attached to result.
loomc_result_diagnostic_count
loomc_host_size_t loomc_result_diagnostic_count(const loomc_result_t *result)
Returns the number of diagnostics attached to result.
loomc_artifact_t
Borrowed artifact view owned by a producer-specific result or product.
Definition
artifact.h:78
loomc_diagnostic_t
Borrowed diagnostic view owned by a result object.
Definition
diagnostic.h:72
loomc
result.h
Generated by
1.17.0