Use StorageClass::kNone for ast local var decls

To declare a local variable, we write `var name : type`, not `var<function> name : type`.
This change fixes all the places where we were feeding StorageClass::kFunction into variable declarations.

Note that the resolved, semantic variable correctly infers the `kFunction` StorageClass.

Change-Id: I6221fabae1de0435044f29b9a91808421d5cace6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50821
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-05-12 21:08:22 +00:00
committed by Commit Bot service account
parent 884a4e2172
commit f6c84e4d45
54 changed files with 380 additions and 410 deletions

View File

@@ -1189,7 +1189,7 @@ class ProgramBuilder {
template <typename NAME>
ast::Variable* Var(NAME&& name,
ast::Type* type,
ast::StorageClass storage,
ast::StorageClass storage = ast::StorageClass::kNone,
ast::Expression* constructor = nullptr,
ast::DecorationList decorations = {}) {
type = ty.MaybeCreateTypename(type);
@@ -1208,7 +1208,7 @@ class ProgramBuilder {
ast::Variable* Var(const Source& source,
NAME&& name,
ast::Type* type,
ast::StorageClass storage,
ast::StorageClass storage = ast::StorageClass::kNone,
ast::Expression* constructor = nullptr,
ast::DecorationList decorations = {}) {
type = ty.MaybeCreateTypename(type);