Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
diagnostic.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_DIAGNOSTIC_H_
8#define LOOMC_DIAGNOSTIC_H_
9
10#include "loomc/source.h"
11
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
34
69
82
96
153
154#ifdef __cplusplus
155} // extern "C"
156#endif
157
158#endif // LOOMC_DIAGNOSTIC_H_
size_t loomc_host_size_t
Host allocation and container size type.
Definition base.h:45
loomc_diagnostic_severity_t
Diagnostic severity.
Definition diagnostic.h:24
@ LOOMC_DIAGNOSTIC_SEVERITY_NOTE
Informational note.
Definition diagnostic.h:26
@ LOOMC_DIAGNOSTIC_SEVERITY_ERROR
Error that makes the operation fail.
Definition diagnostic.h:32
@ LOOMC_DIAGNOSTIC_SEVERITY_WARNING
Warning that does not make the operation fail.
Definition diagnostic.h:29
Immutable source handles used by parsing, indexing, linking, and compiling.
struct loomc_source_t loomc_source_t
Immutable source handle.
Definition source.h:81
A named diagnostic parameter rendered for structured consumers.
Definition diagnostic.h:89
loomc_string_view_t value
Canonical human-readable parameter value.
Definition diagnostic.h:94
loomc_string_view_t name
Stable parameter name from the diagnostic definition.
Definition diagnostic.h:91
Borrowed diagnostic view owned by a result object.
Definition diagnostic.h:103
loomc_string_view_t message
Human-readable rendered message.
Definition diagnostic.h:115
loomc_host_size_t related_location_count
Number of entries in related_locations.
Definition diagnostic.h:133
const loomc_diagnostic_parameter_t * parameters
Named rendered parameters in diagnostic-definition order, or NULL when the count is zero.
Definition diagnostic.h:140
loomc_string_view_t formatted_json
Canonical JSON object for the native compiler diagnostic, without a trailing newline.
Definition diagnostic.h:151
loomc_string_view_t code
Stable diagnostic code.
Definition diagnostic.h:108
const loomc_diagnostic_related_location_t * related_locations
Related locations in producer order, or NULL when the count is zero.
Definition diagnostic.h:130
loomc_source_range_t range
Primary source range.
Definition diagnostic.h:127
loomc_diagnostic_severity_t severity
Diagnostic severity.
Definition diagnostic.h:105
loomc_host_size_t related_location_omitted_count
Number of additional resolved locations omitted by the producer's limit.
Definition diagnostic.h:136
loomc_host_size_t parameter_count
Number of entries in parameters.
Definition diagnostic.h:143
loomc_string_view_t export_name
Stable name of the export whose compilation emitted this diagnostic, or an empty view when the diagno...
Definition diagnostic.h:112
loomc_string_view_t formatted_text
Canonical human-readable rendering of the complete diagnostic.
Definition diagnostic.h:124
Source range attached to a diagnostic.
Definition diagnostic.h:47
uint32_t start_line
One-based starting line, or zero when unavailable.
Definition diagnostic.h:58
uint32_t start_column
One-based starting column, or zero when unavailable.
Definition diagnostic.h:61
const loomc_source_t * source
Source identity with optional contents, or NULL for an unknown source.
Definition diagnostic.h:49
uint32_t end_column
One-based ending column, or zero when unavailable.
Definition diagnostic.h:67
loomc_host_size_t start
First byte in source contents covered by the range.
Definition diagnostic.h:52
loomc_host_size_t end
One-past-last byte in source contents covered by the range.
Definition diagnostic.h:55
uint32_t end_line
One-based ending line, or zero when unavailable.
Definition diagnostic.h:64
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63