Rename type::Array to type::ArrayType

This is to avoid name conflicts once we move all classes from namespace
`type` to `sem`.

Bug: tint:724
Change-Id: Icc3d81ae62eb3b329ce28e78a23ea27f29c9263b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48360
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Antonio Maiorano
2021-04-19 21:13:12 +00:00
committed by Commit Bot service account
parent e94237dcdd
commit cf4057be01
44 changed files with 179 additions and 166 deletions

View File

@@ -42,7 +42,7 @@ ast::ArrayAccessorExpression* BoundArrayAccessors::Transform(
auto& diags = ctx->dst->Diagnostics();
auto* ret_type = ctx->src->Sem().Get(expr->array())->Type()->UnwrapAll();
if (!ret_type->Is<type::Array>() && !ret_type->Is<type::Matrix>() &&
if (!ret_type->Is<type::ArrayType>() && !ret_type->Is<type::Matrix>() &&
!ret_type->Is<type::Vector>()) {
return nullptr;
}
@@ -52,10 +52,10 @@ ast::ArrayAccessorExpression* BoundArrayAccessors::Transform(
uint32_t size = 0;
bool is_vec = ret_type->Is<type::Vector>();
bool is_arr = ret_type->Is<type::Array>();
bool is_arr = ret_type->Is<type::ArrayType>();
if (is_vec || is_arr) {
size = is_vec ? ret_type->As<type::Vector>()->size()
: ret_type->As<type::Array>()->size();
: ret_type->As<type::ArrayType>()->size();
} else {
// The row accessor would have been an embedded array accessor and already
// handled, so we just need to do columns here.

View File

@@ -447,7 +447,7 @@ struct State {
member->Declaration()->type()->UnwrapAll());
values.emplace_back(ctx.dst->Call(load, "buffer", offset));
}
} else if (auto* arr_ty = el_ty->As<type::Array>()) {
} else if (auto* arr_ty = el_ty->As<type::ArrayType>()) {
auto& sem = ctx.src->Sem();
auto* arr = sem.Get(arr_ty);
for (uint32_t i = 0; i < arr_ty->size(); i++) {
@@ -518,7 +518,7 @@ struct State {
auto* call = ctx.dst->Call(store, "buffer", offset, access);
body.emplace_back(ctx.dst->create<ast::CallStatement>(call));
}
} else if (auto* arr_ty = el_ty->As<type::Array>()) {
} else if (auto* arr_ty = el_ty->As<type::ArrayType>()) {
auto& sem = ctx.src->Sem();
auto* arr = sem.Get(arr_ty);
for (uint32_t i = 0; i < arr_ty->size(); i++) {
@@ -678,7 +678,7 @@ Output DecomposeStorageAccess::Run(const Program* in, const DataMap&) {
if (auto* accessor = node->As<ast::ArrayAccessorExpression>()) {
if (auto access = state.TakeAccess(accessor->array())) {
// X[Y]
if (auto* arr_ty = access.type->As<type::Array>()) {
if (auto* arr_ty = access.type->As<type::ArrayType>()) {
auto stride = sem.Get(arr_ty)->Stride();
auto offset = Mul(stride, accessor->idx_expr());
state.AddAccesss(accessor,

View File

@@ -96,7 +96,7 @@ void Hlsl::PromoteInitializersToConstVar(CloneContext& ctx) const {
}
auto* src_ty = src_sem_expr->Type();
if (src_ty->IsAnyOf<type::Array, type::Struct>()) {
if (src_ty->IsAnyOf<type::ArrayType, type::Struct>()) {
// Create a new symbol for the constant
auto dst_symbol = ctx.dst->Symbols().New();
// Clone the type