blob: 7580b2c13efbc37a7aff1bd8c75e4685a0af02b2 [file] [log] [blame]
dan sinclairb5af23d2023-02-19 17:34:44 +00001{{- /*
2--------------------------------------------------------------------------------
3Template file for use with tools/src/cmd/gen to generate diagnostic_control.h
4
5See:
6* tools/src/cmd/gen for structures used by this template
7* https://golang.org/pkg/text/template/ for documentation on the template syntax
8--------------------------------------------------------------------------------
9*/ -}}
10
11{{- Import "src/tint/templates/enums.tmpl.inc" -}}
12
13#ifndef SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_
14#define SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_
15
16#include <ostream>
17#include <string>
18#include <unordered_map>
19
20#include "src/tint/builtin/diagnostic_rule.h"
21#include "src/tint/diagnostic/diagnostic.h"
22
23namespace tint::builtin {
24
25/// The diagnostic severity control.
26{{ Eval "DeclareEnum" (Sem.Enum "diagnostic_severity") }}
27
28/// Convert a DiagnosticSeverity to the corresponding diag::Severity.
29diag::Severity ToSeverity(DiagnosticSeverity sc);
30
31/// DiagnosticRuleSeverities is a map from diagnostic rule to diagnostic severity.
32using DiagnosticRuleSeverities = std::unordered_map<DiagnosticRule, DiagnosticSeverity>;
33
34} // namespace tint::builtin
35
36#endif // SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_