From 46b3b059e9fbc1ff42b73edb81f9ad5b60386a75 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 7 May 2021 15:19:54 +0000 Subject: [PATCH] Allow AST dumping even if resolution failed Fixed: tint:674 Change-Id: I1a13a20c5c2c886d04e3d37a198109e62ad7dad2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50246 Auto-Submit: David Neto Commit-Queue: Ben Clayton Kokoro: Kokoro Reviewed-by: Ben Clayton --- samples/main.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/main.cc b/samples/main.cc index 89567e342d..5346d7274f 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -642,13 +642,14 @@ int main(int argc, const char** argv) { if (program->Diagnostics().count() > 0) { diag_formatter.format(program->Diagnostics(), diag_printer.get()); } - if (!program->IsValid()) { - return 1; - } if (options.dump_ast) { std::cout << std::endl << program->to_str(options.demangle) << std::endl; } + + if (!program->IsValid()) { + return 1; + } if (options.parse_only) { return 1; }