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
68
81
110
111#ifdef __cplusplus
112} // extern "C"
113#endif
114
115#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
Borrowed diagnostic view owned by a result object.
Definition diagnostic.h:88
loomc_string_view_t message
Human-readable rendered message.
Definition diagnostic.h:96
loomc_host_size_t related_location_count
Number of entries in related_locations.
Definition diagnostic.h:105
loomc_string_view_t code
Stable diagnostic code.
Definition diagnostic.h:93
const loomc_diagnostic_related_location_t * related_locations
Related locations in producer order, or NULL when the count is zero.
Definition diagnostic.h:102
loomc_source_range_t range
Primary source range.
Definition diagnostic.h:99
loomc_diagnostic_severity_t severity
Diagnostic severity.
Definition diagnostic.h:90
loomc_host_size_t related_location_omitted_count
Number of additional resolved locations omitted by the producer's limit.
Definition diagnostic.h:108
Source range attached to a diagnostic.
Definition diagnostic.h:46
uint32_t start_line
One-based starting line, or zero when unavailable.
Definition diagnostic.h:57
uint32_t start_column
One-based starting column, or zero when unavailable.
Definition diagnostic.h:60
const loomc_source_t * source
Source identity with optional contents, or NULL for an unknown source.
Definition diagnostic.h:48
uint32_t end_column
One-based ending column, or zero when unavailable.
Definition diagnostic.h:66
loomc_host_size_t start
First byte in source contents covered by the range.
Definition diagnostic.h:51
loomc_host_size_t end
One-past-last byte in source contents covered by the range.
Definition diagnostic.h:54
uint32_t end_line
One-based ending line, or zero when unavailable.
Definition diagnostic.h:63
Non-owning string view over bytes that need not be NUL-terminated.
Definition base.h:63