blob: f7433bfb5165d40eca736e4a74fb9bd354a883d9 [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/utils/templates/enums.tmpl.inc" -}}
#ifndef SRC_TINT_LANG_CORE_BUILTIN_DIAGNOSTIC_SEVERITY_H_
#define SRC_TINT_LANG_CORE_BUILTIN_DIAGNOSTIC_SEVERITY_H_
#include <string>
#include <unordered_map>
#include "src/tint/utils/traits/traits.h"
#include "src/tint/lang/core/builtin/diagnostic_rule.h"
#include "src/tint/utils/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_LANG_CORE_BUILTIN_DIAGNOSTIC_SEVERITY_H_