Introduce semantic::Info
Will hold the mutable fields that currently reside in the otherwise immutable-AST.
Change the AST string methods to accept a `const semantic::Info&`. This is required as some nodes include type-resolved information in their output strings.
Bug: tint:390
Change-Id: Iba494a9c5645ce2096da0a8cfe63a4309a9d9c3c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/39003
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/ast/scalar_constructor_expression.cc b/src/ast/scalar_constructor_expression.cc
index ebbecc6..4c90f19 100644
--- a/src/ast/scalar_constructor_expression.cc
+++ b/src/ast/scalar_constructor_expression.cc
@@ -41,11 +41,12 @@
return literal_ != nullptr;
}
-void ScalarConstructorExpression::to_str(std::ostream& out,
+void ScalarConstructorExpression::to_str(const semantic::Info& sem,
+ std::ostream& out,
size_t indent) const {
make_indent(out, indent);
- out << "ScalarConstructor[" << result_type_str() << "]{" << literal_->to_str()
- << "}" << std::endl;
+ out << "ScalarConstructor[" << result_type_str(sem) << "]{"
+ << literal_->to_str(sem) << "}" << std::endl;
}
} // namespace ast