blob: 40714cbce4d5ad7a633245d02345e9a5e927f195 [file] [log] [blame] [edit]
{{- /*
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
*/ -}}
{{- $I := LoadIntrinsics "src/tint/lang/wgsl/wgsl.def" -}}
{{- Import "src/tint/utils/templates/enums.tmpl.inc" -}}
#ifndef SRC_TINT_LANG_WGSL_DIAGNOSTIC_SEVERITY_H_
#define SRC_TINT_LANG_WGSL_DIAGNOSTIC_SEVERITY_H_
#include <string>
#include "src/tint/lang/wgsl/diagnostic_rule.h"
#include "src/tint/utils/containers/hashmap.h"
#include "src/tint/utils/diagnostic/diagnostic.h"
#include "src/tint/utils/traits/traits.h"
namespace tint::wgsl {
/// The diagnostic severity control.
{{ Eval "DeclareEnum" ($I.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 = Hashmap<DiagnosticRule, DiagnosticSeverity, 1>;
} // namespace tint::wgsl
#endif // SRC_TINT_LANG_WGSL_DIAGNOSTIC_SEVERITY_H_