[ast] Add the result_type into the AST dump

This CL adds the result_type type_name into the AST dump if available.

Bug: tint:310, tint:308
Change-Id: Iea678fd4f7a2dadbfca86f29043c75459c421cb3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32780
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2020-11-16 14:46:27 +00:00
committed by Commit Bot service account
parent 112314b73d
commit 80598edf78
43 changed files with 2373 additions and 2326 deletions

View File

@@ -482,15 +482,7 @@ int main(int argc, const char** argv) {
tint::diag::Formatter().format(reader->diagnostics(), printer.get());
return 1;
}
auto mod = reader->module();
if (options.dump_ast) {
std::cout << std::endl << mod.to_str() << std::endl;
}
if (options.parse_only) {
return 1;
}
if (!mod.IsValid()) {
std::cerr << "Invalid module generated..." << std::endl;
return 1;
@@ -502,6 +494,13 @@ int main(int argc, const char** argv) {
return 1;
}
if (options.dump_ast) {
std::cout << std::endl << mod.to_str() << std::endl;
}
if (options.parse_only) {
return 1;
}
tint::Validator v;
if (!v.Validate(&mod)) {
std::cerr << "Validation: " << v.error() << std::endl;