Move array to type/
This CL moves array to the type/ folder. Namespaces are updated as
needed. A FriendlyName method was added to ArrayCount so the sem::
ArrayCount entries do not need to be referenced inside type/.
Bug: tint:1718
Change-Id: I16a8f32b3fab1131b284a6981a5c386081138b08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113427
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/transform/calculate_array_length.cc b/src/tint/transform/calculate_array_length.cc
index 25cec21..65821c9 100644
--- a/src/tint/transform/calculate_array_length.cc
+++ b/src/tint/transform/calculate_array_length.cc
@@ -202,16 +202,16 @@
const ast::Expression* total_size =
b.Expr(buffer_size_result->variable);
- const sem::Array* array_type = Switch(
+ const type::Array* array_type = Switch(
storage_buffer_type->StoreType(),
[&](const sem::Struct* str) {
// The variable is a struct, so subtract the byte offset of
// the array member.
auto* array_member_sem = str->Members().Back();
total_size = b.Sub(total_size, u32(array_member_sem->Offset()));
- return array_member_sem->Type()->As<sem::Array>();
+ return array_member_sem->Type()->As<type::Array>();
},
- [&](const sem::Array* arr) { return arr; });
+ [&](const type::Array* arr) { return arr; });
if (!array_type) {
TINT_ICE(Transform, b.Diagnostics())