dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 1 | {{- /* |
| 2 | -------------------------------------------------------------------------------- |
| 3 | Template file for use with tools/src/cmd/gen to generate diagnostic_control.h |
| 4 | |
| 5 | See: |
| 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 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 11 | {{- $I := LoadIntrinsics "src/tint/lang/wgsl/wgsl.def" -}} |
dan sinclair | 22b4dd2 | 2023-07-21 00:40:07 +0000 | [diff] [blame] | 12 | {{- Import "src/tint/utils/templates/enums.tmpl.inc" -}} |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 13 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 14 | #ifndef SRC_TINT_LANG_WGSL_DIAGNOSTIC_RULE_H_ |
| 15 | #define SRC_TINT_LANG_WGSL_DIAGNOSTIC_RULE_H_ |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 16 | |
Stephan Hartmann | 9141e91 | 2023-08-14 15:56:22 +0000 | [diff] [blame] | 17 | #include <cstdint> |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 18 | #include <string> |
Ben Clayton | 7883a0c | 2023-04-20 23:51:53 +0000 | [diff] [blame] | 19 | #include <variant> |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 20 | |
Ben Clayton | 6891960 | 2023-07-28 22:51:18 +0000 | [diff] [blame] | 21 | #include "src/tint/utils/traits/traits.h" |
dan sinclair | 6cc183c | 2023-03-02 21:28:45 +0000 | [diff] [blame] | 22 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 23 | namespace tint::wgsl { |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 24 | |
Ben Clayton | 7883a0c | 2023-04-20 23:51:53 +0000 | [diff] [blame] | 25 | /// WGSL core diagnostic rules. |
Ben Clayton | 2dffb3c | 2023-08-07 12:35:33 +0000 | [diff] [blame] | 26 | {{ Eval "DeclareEnum" ($I.Sem.Enum "core_diagnostic_rule") }} |
Ben Clayton | 7883a0c | 2023-04-20 23:51:53 +0000 | [diff] [blame] | 27 | |
| 28 | /// Chromium-specific diagnostic rules. |
Ben Clayton | 2dffb3c | 2023-08-07 12:35:33 +0000 | [diff] [blame] | 29 | {{ Eval "DeclareEnum" ($I.Sem.Enum "chromium_diagnostic_rule") }} |
Ben Clayton | 7883a0c | 2023-04-20 23:51:53 +0000 | [diff] [blame] | 30 | |
| 31 | /// All diagnostic rules understood by Tint. |
| 32 | using DiagnosticRule = std::variant<CoreDiagnosticRule, ChromiumDiagnosticRule>; |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 33 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 34 | } // namespace tint::wgsl |
dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 35 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 36 | #endif // SRC_TINT_LANG_WGSL_DIAGNOSTIC_RULE_H_ |