[sem] Move TransitivelyReferencedOverrides to sem::Info.

This CL pulls the TransitivelyReferencedOverrides from sem::Array and
sem::GlobalVariable up to the sem::Info.

Moving this data outside of sem::Array removes one of the references to
non-Type sem content.

Bug: tint:1718
Change-Id: I40c1c8b2d5ec60dc2723b56cc30cd436e9b7e997
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112324
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2022-12-01 15:33:43 +00:00
committed by Dawn LUCI CQ
parent 331a3b7980
commit 527e38b68b
6 changed files with 66 additions and 41 deletions

View File

@@ -71,9 +71,12 @@ Transform::ApplyResult SingleEntryPoint::Apply(const Program* src,
[&](const ast::TypeDecl* ty) {
// Strip aliases that reference unused override declarations.
if (auto* arr = sem.Get(ty)->As<sem::Array>()) {
for (auto* o : arr->TransitivelyReferencedOverrides()) {
if (!referenced_vars.Contains(o)) {
return;
auto* refs = sem.TransitivelyReferencedOverrides(arr);
if (refs) {
for (auto* o : *refs) {
if (!referenced_vars.Contains(o)) {
return;
}
}
}
}