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

@@ -398,7 +398,7 @@ std::vector<ResourceBinding> Inspector::GetUniformBufferResourceBindings(
auto* sem = program_->Sem().Get(str);
if (!sem) {
error_ = "Missing semantic information for structure " +
program_->Symbols().NameFor(str->symbol());
program_->Symbols().NameFor(str->impl()->name());
continue;
}
@@ -614,7 +614,7 @@ std::vector<ResourceBinding> Inspector::GetStorageBufferResourceBindingsImpl(
auto* sem = program_->Sem().Get(str);
if (!sem) {
error_ = "Missing semantic information for structure " +
program_->Symbols().NameFor(str->symbol());
program_->Symbols().NameFor(str->impl()->name());
continue;
}

View File

@@ -227,7 +227,7 @@ class InspectorHelper : public ProgramBuilder {
auto sym = Sym(name);
auto* str = create<ast::Struct>(sym, members, decos);
auto* str_ty = ty.struct_(sym, str);
auto* str_ty = ty.struct_(str);
AST().AddConstructedType(str_ty);
return str_ty;
}
@@ -1829,7 +1829,7 @@ TEST_F(InspectorGetUniformBufferResourceBindingsTest, MissingBlockDeco) {
ast::StructMemberList{Member(StructMemberName(0, ty.i32()), ty.i32())},
decos);
auto* foo_type = ty.struct_("foo_type", str);
auto* foo_type = ty.struct_(str);
AddUniformBuffer("foo_ub", foo_type, 0, 0);
MakeStructVariableReferenceBodyFunction("ub_func", "foo_ub", {{0, ty.i32()}});