ProgramBuilder: Swap parameter order for Var and Const

Move the storage parameter after type.
Const() has no use for storage classes, so this parameter will be removed in the next change.
This reordering keeps Var() and Const() parameter types identical for the first two non-optional fields

Change-Id: I66669d19fa2175c4f10f615941e69efcab4c23e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41540
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2021-02-16 23:57:01 +00:00
committed by Commit Bot service account
parent 4b9e7f92b9
commit 37571bc32d
62 changed files with 700 additions and 702 deletions

View File

@@ -84,7 +84,7 @@ void Hlsl::PromoteArrayInitializerToConstVar(CloneContext& ctx) const {
auto* dst_init = ctx.Clone(src_init);
// Construct the constant that holds the array
auto* dst_var = ctx.dst->Const(
dst_symbol, ast::StorageClass::kFunction, dst_array_ty, dst_init);
dst_symbol, dst_array_ty, ast::StorageClass::kFunction, dst_init);
// Construct the variable declaration statement
auto* dst_var_decl =
ctx.dst->create<ast::VariableDeclStatement>(dst_var);

View File

@@ -68,9 +68,9 @@ void Spirv::HandleSampleMaskBuiltins(CloneContext& ctx) const {
// Use `array<u32, 1>` for the new variable.
auto* type = ctx.dst->ty.array(ctx.dst->ty.u32(), 1u);
// Create the new variable.
auto* var_arr =
ctx.dst->Var(var->source(), var_name, var->declared_storage_class(),
type, nullptr, ctx.Clone(var->decorations()));
auto* var_arr = ctx.dst->Var(var->source(), var_name, type,
var->declared_storage_class(), nullptr,
ctx.Clone(var->decorations()));
// Replace the variable with the arrayed version.
ctx.Replace(var, var_arr);