[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>
diff --git a/src/ast/scalar_constructor_expression.cc b/src/ast/scalar_constructor_expression.cc
index 287cb36..52b3ed2 100644
--- a/src/ast/scalar_constructor_expression.cc
+++ b/src/ast/scalar_constructor_expression.cc
@@ -45,7 +45,8 @@
void ScalarConstructorExpression::to_str(std::ostream& out,
size_t indent) const {
make_indent(out, indent);
- out << "ScalarConstructor{" << literal_->to_str() << "}" << std::endl;
+ out << "ScalarConstructor[" << result_type_str() << "]{" << literal_->to_str()
+ << "}" << std::endl;
}
} // namespace ast