sem: Fold together sem::Array and sem::ArrayType

There's now no need to have both.
Removes a whole bunch of Sem().Get() smell, and simplifies the resolver.

Also fixes a long-standing issue where an array with an explicit, but equal-to-implicit-stride attribute would result in a different type to an array without the decoration.

Bug: tint:724
Fixed: tint:782
Change-Id: I0202459009cd45be427cdb621993a5a3b07ff51e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50301
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-05-07 20:58:34 +00:00
committed by Commit Bot service account
parent 6732e8561c
commit 4cd5eea87e
62 changed files with 486 additions and 591 deletions

View File

@@ -270,7 +270,6 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/scope_stack_test.cc",
"../src/sem/access_control_type_test.cc",
"../src/sem/alias_type_test.cc",
"../src/sem/array_type_test.cc",
"../src/sem/bool_type_test.cc",
"../src/sem/depth_texture_type_test.cc",
"../src/sem/external_texture_type_test.cc",
@@ -281,6 +280,7 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/sem/pointer_type_test.cc",
"../src/sem/sampled_texture_type_test.cc",
"../src/sem/sampler_type_test.cc",
"../src/sem/sem_array_test.cc",
"../src/sem/sem_struct_test.cc",
"../src/sem/storage_texture_type_test.cc",
"../src/sem/texture_type_test.cc",

8
test/bug_tint_782.wgsl Normal file
View File

@@ -0,0 +1,8 @@
type ArrayExplicitStride = [[stride(4)]] array<i32, 2>;
type ArrayImplicitStride = array<i32, 2>;
fn foo() {
var explicit : ArrayExplicitStride;
var implict : ArrayImplicitStride;
implict = explicit;
}