Access struct member name through sem.

This CL changes the uses of Declaration()->symbol for struct members in
the sem to access the `Name` directly.

Bug: tint:1718
Change-Id: I3050147b97bea66d6c283e176a7152f36eb2b25f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112444
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
dan sinclair
2022-12-01 14:52:33 +00:00
committed by Dawn LUCI CQ
parent d5d207ba9f
commit c5b1b5c77a
9 changed files with 18 additions and 21 deletions

View File

@@ -3620,7 +3620,7 @@ bool Resolver::ApplyAddressSpaceUsageToType(ast::AddressSpace address_space,
decl->type->source)) {
std::stringstream err;
err << "while analyzing structure member " << sem_.TypeNameOf(str) << "."
<< builder_->Symbols().NameFor(decl->symbol);
<< builder_->Symbols().NameFor(member->Name());
AddNote(err.str(), decl->source);
return false;
}

View File

@@ -413,7 +413,7 @@ bool Validator::AddressSpaceLayout(const sem::Type* store_ty,
};
auto member_name_of = [this](const sem::StructMember* sm) {
return symbols_.NameFor(sm->Declaration()->symbol);
return symbols_.NameFor(sm->Name());
};
// Only validate the [type + address space] once