ast::Module: Move ConstructedTypes() to typ::Type

And add a few additional helper methods.
Stepping stone to having the module only reference AST nodes.

Bug: tint:724
Change-Id: Ib321dadce5f739afe4f71cbafde9dd2d1c6431bb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49743
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton
2021-05-04 18:03:11 +00:00
committed by Commit Bot service account
parent 0f88b31503
commit 49a545c919
7 changed files with 42 additions and 12 deletions

View File

@@ -65,7 +65,7 @@ Output CanonicalizeEntryPointIO::Run(const Program* in, const DataMap&) {
// Strip entry point IO decorations from struct declarations.
// TODO(jrprice): This code is duplicated with the SPIR-V transform.
for (auto* ty : ctx.src->AST().ConstructedTypes()) {
for (auto ty : ctx.src->AST().ConstructedTypes()) {
if (auto* struct_ty = ty->As<sem::StructType>()) {
// Build new list of struct members without entry point IO decorations.
ast::StructMemberList new_struct_members;

View File

@@ -110,7 +110,7 @@ void Spirv::HandleEntryPointIOTypes(CloneContext& ctx) const {
// ```
// Strip entry point IO decorations from struct declarations.
for (auto* ty : ctx.src->AST().ConstructedTypes()) {
for (auto ty : ctx.src->AST().ConstructedTypes()) {
if (auto* struct_ty = ty->As<sem::StructType>()) {
// Build new list of struct members without entry point IO decorations.
ast::StructMemberList new_struct_members;