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
61
62
#ifdef __cplusplus
63
extern
"C"
{
64
#endif
65
71
typedef
struct
loomc_result_t
loomc_result_t
;
72
74
typedef
enum
loomc_result_state_e {
76
LOOMC_RESULT_STATE_SUCCEEDED
= 0,
77
79
LOOMC_RESULT_STATE_FAILED
= 1,
80
82
LOOMC_RESULT_STATE_CANCELLED
= 2,
83
}
loomc_result_state_t
;
84
91
LOOMC_API_EXPORT
void
loomc_result_retain
(
loomc_result_t
* result);
92
100
LOOMC_API_EXPORT
void
loomc_result_release
(
loomc_result_t
* result);
101
106
LOOMC_API_EXPORT
loomc_result_state_t
107
loomc_result_state
(
const
loomc_result_t
* result);
108
114
LOOMC_API_EXPORT
bool
loomc_result_succeeded
(
const
loomc_result_t
* result);
115
120
LOOMC_API_EXPORT
loomc_host_size_t
121
loomc_result_diagnostic_count
(
const
loomc_result_t
* result);
122
131
LOOMC_API_EXPORT
const
loomc_diagnostic_t
*
loomc_result_diagnostic_at
(
132
const
loomc_result_t
* result,
loomc_host_size_t
index);
133
138
LOOMC_API_EXPORT
loomc_host_size_t
139
loomc_result_artifact_count
(
const
loomc_result_t
* result);
140
149
LOOMC_API_EXPORT
const
loomc_artifact_t
*
loomc_result_artifact_at
(
150
const
loomc_result_t
* result,
loomc_host_size_t
index);
151
152
#ifdef __cplusplus
153
}
// extern "C"
154
#endif
155
156
#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:74
LOOMC_RESULT_STATE_FAILED
@ LOOMC_RESULT_STATE_FAILED
Operation completed with diagnostics and no infrastructure status failure.
Definition
result.h:79
LOOMC_RESULT_STATE_CANCELLED
@ LOOMC_RESULT_STATE_CANCELLED
Operation completed after observing cancellation.
Definition
result.h:82
LOOMC_RESULT_STATE_SUCCEEDED
@ LOOMC_RESULT_STATE_SUCCEEDED
Operation succeeded and requested outputs are available.
Definition
result.h:76
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:71
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:88
loomc
result.h
Generated by
1.17.0