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
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
65
77
85
94
101
108
115
125 const loomc_result_t* result, loomc_host_size_t index);
126
133
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_
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:67
@ LOOMC_RESULT_STATE_FAILED
Operation completed with diagnostics and no infrastructure status failure.
Definition result.h:72
@ LOOMC_RESULT_STATE_CANCELLED
Operation completed after observing cancellation.
Definition result.h:75
@ LOOMC_RESULT_STATE_SUCCEEDED
Operation succeeded and requested outputs are available.
Definition result.h:69
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:64
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 producer-specific result or product.
Definition artifact.h:78
Borrowed diagnostic view owned by a result object.
Definition diagnostic.h:72