From 63e7ad699c5a4c564d27f78af030d174c7b203bb Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 4 Aug 2021 20:19:28 +0000 Subject: [PATCH] diag: Remove ICE bug report message We're about to go into a Chrome Origin Trial, and crbug.com/tint is not the correct place to file Chrome related bugs. Move this message to the tint executable, which is code not used by chrome. Change-Id: Ib33630164fa5d7bec3c581e5eca6ff188921eef8 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60562 Auto-Submit: Ben Clayton Reviewed-by: James Price Commit-Queue: Ben Clayton Kokoro: Ben Clayton --- samples/main.cc | 10 ++++++++++ src/diagnostic/formatter.cc | 16 ---------------- src/diagnostic/formatter_test.cc | 14 -------------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/samples/main.cc b/samples/main.cc index 729978d1ac..61099c1d2b 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -34,6 +34,16 @@ namespace { const tint::diag::List& diagnostics) { auto printer = tint::diag::Printer::create(stderr, true); tint::diag::Formatter{}.format(diagnostics, printer.get()); + tint::diag::Style bold_red{tint::diag::Color::kRed, true}; + constexpr const char* please_file_bug = R"( +******************************************************************** +* The tint shader compiler has encountered an unexpected error. * +* * +* Please help us fix this issue by submitting a bug report at * +* crbug.com/tint with the source program that triggered the bug. * +******************************************************************** +)"; + printer->write(please_file_bug, bold_red); exit(1); } diff --git a/src/diagnostic/formatter.cc b/src/diagnostic/formatter.cc index e162c89a53..c613876bc1 100644 --- a/src/diagnostic/formatter.cc +++ b/src/diagnostic/formatter.cc @@ -112,7 +112,6 @@ Formatter::Formatter(const Style& style) : style_(style) {} void Formatter::format(const List& list, Printer* printer) const { State state{printer}; - bool please_report_bug = false; bool first = true; for (auto diag : list) { state.set_style({}); @@ -121,21 +120,6 @@ void Formatter::format(const List& list, Printer* printer) const { } format(diag, state); first = false; - - if (static_cast(diag.severity) > static_cast(Severity::Error)) { - please_report_bug = true; - } - } - if (please_report_bug) { - state.set_style({Color::kRed, true}); - state << R"( -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** -)"; } if (style_.print_newline_at_end) { diff --git a/src/diagnostic/formatter_test.cc b/src/diagnostic/formatter_test.cc index 08565ab99e..f77b847a6b 100644 --- a/src/diagnostic/formatter_test.cc +++ b/src/diagnostic/formatter_test.cc @@ -188,13 +188,6 @@ TEST_F(DiagFormatterTest, ICE) { the snail says ??? ^^^ -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - )"; ASSERT_EQ(expect, got); } @@ -206,13 +199,6 @@ TEST_F(DiagFormatterTest, Fatal) { the snail says ??? ^^^ -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** - )"; ASSERT_EQ(expect, got); }