Loom C API
Public Loom compiler C API
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
55extern "C" {
56#endif
57
64
76
84
93
100
107
114
124 const loomc_result_t* result, loomc_host_size_t index);
125
132
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_
In-memory output artifacts produced by compiler operations.
#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
Structured diagnostics produced by completed operations.
void loomc_result_release(loomc_result_t *result)
Releases result from one owner.
loomc_result_state_t
Terminal operation-domain state.
Definition result.h:66
@ LOOMC_RESULT_STATE_FAILED
Operation completed with diagnostics and no infrastructure status failure.
Definition result.h:71
@ LOOMC_RESULT_STATE_CANCELLED
Operation completed after observing cancellation.
Definition result.h:74
@ LOOMC_RESULT_STATE_SUCCEEDED
Operation succeeded and requested outputs are available.
Definition result.h:68
loomc_result_state_t loomc_result_state(const loomc_result_t *result)
Returns the result state.
const loomc_diagnostic_t * loomc_result_diagnostic_at(const loomc_result_t *result, loomc_host_size_t index)
Returns a diagnostic by index.
void loomc_result_retain(loomc_result_t *result)
Retains result for another owner.
const loomc_artifact_t * loomc_result_artifact_at(const loomc_result_t *result, loomc_host_size_t index)
Returns an artifact by index.
bool loomc_result_succeeded(const loomc_result_t *result)
Returns true when result succeeded.
struct loomc_result_t loomc_result_t
Immutable operation result.
Definition result.h:63
loomc_host_size_t loomc_result_artifact_count(const loomc_result_t *result)
Returns the number of artifacts attached to result.
loomc_host_size_t loomc_result_diagnostic_count(const loomc_result_t *result)
Returns the number of diagnostics attached to result.
Borrowed artifact view owned by a result object.
Definition artifact.h:75
Borrowed diagnostic view owned by a result object.
Definition diagnostic.h:72