diag: Add System enumerator to all diagnostics
Describes what Tint system raised the diagnostic.
Use this information in the fuzzers to distinguish between expected and unexpected failure cases in the Transform fuzzer tests.
Fixed: chromium:1206407
Fixed: chromium:1207154
Change-Id: I3b807acafe384a2fc363d2a4165a29693450b3cf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55254
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/src/debug.cc b/src/debug.cc
index 7f20d09..03a6fde 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -27,12 +27,13 @@
InternalCompilerError::InternalCompilerError(const char* file,
size_t line,
+ diag::System system,
diag::List& diagnostics)
- : file_(file), line_(line), diagnostics_(diagnostics) {}
+ : file_(file), line_(line), system_(system), diagnostics_(diagnostics) {}
InternalCompilerError::~InternalCompilerError() {
Source source{Source::Range{Source::Location{line_}}, file_};
- diagnostics_.add_ice(msg_.str(), source);
+ diagnostics_.add_ice(system_, msg_.str(), source);
if (ice_reporter) {
ice_reporter(diagnostics_);