blob: 7773d6ca2f823436d9fe23029b980eec3308f5d9 [file] [log] [blame]
{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate diagnostic_control.h
See:
* tools/src/cmd/gen for structures used by this template
* https://golang.org/pkg/text/template/ for documentation on the template syntax
--------------------------------------------------------------------------------
*/ -}}
{{- Import "src/tint/templates/enums.tmpl.inc" -}}
#ifndef SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_
#define SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_
#include <string>
#include <unordered_map>
#include "src/tint/utils/string_stream.h"
#include "src/tint/builtin/diagnostic_rule.h"
#include "src/tint/diagnostic/diagnostic.h"
namespace tint::builtin {
/// The diagnostic severity control.
{{ Eval "DeclareEnum" (Sem.Enum "diagnostic_severity") }}
/// Convert a DiagnosticSeverity to the corresponding diag::Severity.
diag::Severity ToSeverity(DiagnosticSeverity sc);
/// DiagnosticRuleSeverities is a map from diagnostic rule to diagnostic severity.
using DiagnosticRuleSeverities = std::unordered_map<DiagnosticRule, DiagnosticSeverity>;
} // namespace tint::builtin
#endif // SRC_TINT_BUILTIN_DIAGNOSTIC_SEVERITY_H_