Moved sem::ArrayCount to an inherited structure
This CL moves the ArrayCount from a variant to use inheritance. This
will allow the sem to have different array count classes from the IR.
The ArrayCounts, similar to types, are unique across the code base and
are provided by the TypeManager.
Bug: tint:1718
Change-Id: Ib9c7c9df881e7a34cc3def2ff29571f536d66244
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112441
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/resolver/resolver_test_helper.h b/src/tint/resolver/resolver_test_helper.h
index fe33c26..f2567c8 100644
--- a/src/tint/resolver/resolver_test_helper.h
+++ b/src/tint/resolver/resolver_test_helper.h
@@ -659,9 +659,11 @@
/// @return the semantic array type
static inline const sem::Type* Sem(ProgramBuilder& b) {
auto* el = DataType<T>::Sem(b);
- sem::ArrayCount count = sem::ConstantArrayCount{N};
+ const sem::ArrayCount* count = nullptr;
if (N == 0) {
- count = sem::RuntimeArrayCount{};
+ count = b.create<sem::RuntimeArrayCount>();
+ } else {
+ count = b.create<sem::ConstantArrayCount>(N);
}
return b.create<sem::Array>(
/* element */ el,