sem::StructType remove symbol()

The name now lives on the ast::Struct. Use that instead.

Bug: tint:724
Change-Id: I4ee5e9b29973e468edd8df8c5448816b36f0fca6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48384
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-04-20 15:21:21 +00:00
committed by Commit Bot service account
parent 8a8d26bbd9
commit 913a2f4b2a
22 changed files with 87 additions and 100 deletions

View File

@@ -81,11 +81,11 @@ Output CanonicalizeEntryPointIO::Run(const Program* in, const DataMap&) {
}
// Redeclare the struct.
auto new_struct_name = ctx.Clone(struct_ty->symbol());
auto* new_struct = ctx.dst->create<sem::StructType>(
new_struct_name, ctx.dst->create<ast::Struct>(
new_struct_name, new_struct_members,
ctx.Clone(struct_ty->impl()->decorations())));
auto new_struct_name = ctx.Clone(struct_ty->impl()->name());
auto* new_struct =
ctx.dst->create<sem::StructType>(ctx.dst->create<ast::Struct>(
new_struct_name, new_struct_members,
ctx.Clone(struct_ty->impl()->decorations())));
ctx.Replace(struct_ty, new_struct);
}
}
@@ -176,10 +176,9 @@ Output CanonicalizeEntryPointIO::Run(const Program* in, const DataMap&) {
// Create the new struct type.
auto in_struct_name = ctx.dst->Symbols().New();
auto* in_struct = ctx.dst->create<sem::StructType>(
in_struct_name,
ctx.dst->create<ast::Struct>(in_struct_name, new_struct_members,
ast::DecorationList{}));
auto* in_struct =
ctx.dst->create<sem::StructType>(ctx.dst->create<ast::Struct>(
in_struct_name, new_struct_members, ast::DecorationList{}));
ctx.InsertBefore(ctx.src->AST().GlobalDeclarations(), func, in_struct);
// Create a new function parameter using this struct type.
@@ -223,10 +222,9 @@ Output CanonicalizeEntryPointIO::Run(const Program* in, const DataMap&) {
// Create the new struct type.
auto out_struct_name = ctx.dst->Symbols().New();
auto* out_struct = ctx.dst->create<sem::StructType>(
out_struct_name,
ctx.dst->create<ast::Struct>(out_struct_name, new_struct_members,
ast::DecorationList{}));
auto* out_struct =
ctx.dst->create<sem::StructType>(ctx.dst->create<ast::Struct>(
out_struct_name, new_struct_members, ast::DecorationList{}));
ctx.InsertBefore(ctx.src->AST().GlobalDeclarations(), func, out_struct);
new_ret_type = out_struct;

View File

@@ -126,11 +126,11 @@ void Spirv::HandleEntryPointIOTypes(CloneContext& ctx) const {
}
// Redeclare the struct.
auto new_struct_name = ctx.Clone(struct_ty->symbol());
auto* new_struct = ctx.dst->create<sem::StructType>(
new_struct_name, ctx.dst->create<ast::Struct>(
new_struct_name, new_struct_members,
ctx.Clone(struct_ty->impl()->decorations())));
auto new_struct_name = ctx.Clone(struct_ty->impl()->name());
auto* new_struct =
ctx.dst->create<sem::StructType>(ctx.dst->create<ast::Struct>(
new_struct_name, new_struct_members,
ctx.Clone(struct_ty->impl()->decorations())));
ctx.Replace(struct_ty, new_struct);
}
}