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
53
54
#ifdef __cplusplus
55
extern
"C"
{
56
#endif
57
63
typedef
struct
loomc_result_t
loomc_result_t
;
64
66
typedef
enum
loomc_result_state_e {
68
LOOMC_RESULT_STATE_SUCCEEDED
= 0,
69
71
LOOMC_RESULT_STATE_FAILED
= 1,
72
74
LOOMC_RESULT_STATE_CANCELLED
= 2,
75
}
loomc_result_state_t
;
76
83
LOOMC_API_EXPORT
void
loomc_result_retain
(
loomc_result_t
* result);
84
92
LOOMC_API_EXPORT
void
loomc_result_release
(
loomc_result_t
* result);
93
98
LOOMC_API_EXPORT
loomc_result_state_t
99
loomc_result_state
(
const
loomc_result_t
* result);
100
106
LOOMC_API_EXPORT
bool
loomc_result_succeeded
(
const
loomc_result_t
* result);
107
112
LOOMC_API_EXPORT
loomc_host_size_t
113
loomc_result_diagnostic_count
(
const
loomc_result_t
* result);
114
123
LOOMC_API_EXPORT
const
loomc_diagnostic_t
*
loomc_result_diagnostic_at
(
124
const
loomc_result_t
* result,
loomc_host_size_t
index);
125
130
LOOMC_API_EXPORT
loomc_host_size_t
131
loomc_result_artifact_count
(
const
loomc_result_t
* result);
132
141
LOOMC_API_EXPORT
const
loomc_artifact_t
*
loomc_result_artifact_at
(
142
const
loomc_result_t
* result,
loomc_host_size_t
index);
143
144
#ifdef __cplusplus
145
}
// extern "C"
146
#endif
147
148
#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:66
LOOMC_RESULT_STATE_FAILED
@ LOOMC_RESULT_STATE_FAILED
Operation completed with diagnostics and no infrastructure status failure.
Definition
result.h:71
LOOMC_RESULT_STATE_CANCELLED
@ LOOMC_RESULT_STATE_CANCELLED
Operation completed after observing cancellation.
Definition
result.h:74
LOOMC_RESULT_STATE_SUCCEEDED
@ LOOMC_RESULT_STATE_SUCCEEDED
Operation succeeded and requested outputs are available.
Definition
result.h:68
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:63
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 result object.
Definition
artifact.h:75
loomc_diagnostic_t
Borrowed diagnostic view owned by a result object.
Definition
diagnostic.h:72
loomc
result.h
Generated by
1.17.0