From 21571709a2f6ef64596956b78762f35bdc96ccc0 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 21 Feb 2023 16:55:07 +0000 Subject: [PATCH] Remove the `type` keyword. `type` has been deprecated in favour of `alias`. This CL removes the deprecation warning and moves `type` to a reserved word. Bug: tint:1812 Change-Id: I05246b9887a0890ae8343a0a132bd6f93353d5ae Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120540 Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Dan Sinclair --- docs/tint/origin-trial-changes.md | 1 + .../end2end/DepthStencilSamplingTests.cpp | 2 +- src/tint/ast/module_clone_test.cc | 8 +- src/tint/reader/wgsl/lexer.cc | 3 - src/tint/reader/wgsl/lexer_test.cc | 1 - src/tint/reader/wgsl/parser_impl.cc | 16 ++-- .../reader/wgsl/parser_impl_error_msg_test.cc | 74 +++---------------- .../wgsl/parser_impl_global_decl_test.cc | 45 ----------- .../wgsl/parser_impl_reserved_keyword_test.cc | 1 + .../wgsl/parser_impl_type_alias_test.cc | 30 +++----- src/tint/reader/wgsl/token.cc | 2 - src/tint/reader/wgsl/token.h | 2 - .../transform/add_block_attribute_test.cc | 10 +-- .../canonicalize_entry_point_io_test.cc | 16 ++-- src/tint/transform/combine_samplers_test.cc | 4 +- .../transform/decompose_memory_access_test.cc | 16 ++-- .../transform/direct_variable_access_test.cc | 8 +- ...ule_scope_var_to_entry_point_param_test.cc | 4 +- .../multiplanar_external_texture_test.cc | 6 +- src/tint/transform/preserve_padding_test.cc | 2 +- src/tint/transform/renamer_test.cc | 2 +- src/tint/transform/single_entry_point_test.cc | 2 +- src/tint/transform/spirv_atomic_test.cc | 8 +- src/tint/transform/unshadow_test.cc | 8 +- .../zero_init_workgroup_memory_test.cc | 2 +- 25 files changed, 78 insertions(+), 195 deletions(-) diff --git a/docs/tint/origin-trial-changes.md b/docs/tint/origin-trial-changes.md index 1c17f18b68..4641068297 100644 --- a/docs/tint/origin-trial-changes.md +++ b/docs/tint/origin-trial-changes.md @@ -6,6 +6,7 @@ * The `sig` member of the return type of `frexp()` has been renamed to `fract`. [tint:1766](crbug.com/tint/1766) * Calling a function with multiple pointer arguments that alias each other is now a error. [tint:1675](crbug.com/tint/1675) +* `type` deprecation has been removed. `alias` must be used now. [tint:1812](crbug.com/tint/1812) ## Changes for M111 diff --git a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp index 0d20c7662c..58f84f23a6 100644 --- a/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/dawn/tests/end2end/DepthStencilSamplingTests.cpp @@ -79,7 +79,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams components, std::ostringstream& shaderSource, std::ostringstream& shaderBody) { - shaderSource << "type StencilValues = array;\n"; + shaderSource << "alias StencilValues = array;\n"; shaderSource << R"( struct DepthResult { value : f32 diff --git a/src/tint/ast/module_clone_test.cc b/src/tint/ast/module_clone_test.cc index 7bda881664..8657980d6c 100644 --- a/src/tint/ast/module_clone_test.cc +++ b/src/tint/ast/module_clone_test.cc @@ -42,8 +42,8 @@ struct S1 { const c0 : i32 = 10; const c1 : bool = true; -type t0 = array>; -type t1 = array>; +alias t0 = array>; +alias t1 = array>; var g0 : u32 = 20u; var g1 : f32 = 123.0; @@ -111,11 +111,11 @@ fn main() { const declaration_order_check_0 : i32 = 1; -type declaration_order_check_1 = f32; +alias declaration_order_check_1 = f32; fn declaration_order_check_2() {} -type declaration_order_check_3 = f32; +alias declaration_order_check_3 = f32; const declaration_order_check_4 : i32 = 1; diff --git a/src/tint/reader/wgsl/lexer.cc b/src/tint/reader/wgsl/lexer.cc index 46c15be42d..58bbd58dfa 100644 --- a/src/tint/reader/wgsl/lexer.cc +++ b/src/tint/reader/wgsl/lexer.cc @@ -1193,9 +1193,6 @@ Token Lexer::check_keyword(const Source& source, std::string_view str) { if (str == "true") { return {Token::Type::kTrue, source, "true"}; } - if (str == "type") { - return {Token::Type::kType, source, "type"}; - } if (str == "var") { return {Token::Type::kVar, source, "var"}; } diff --git a/src/tint/reader/wgsl/lexer_test.cc b/src/tint/reader/wgsl/lexer_test.cc index d2a875a29a..4eec80bc89 100644 --- a/src/tint/reader/wgsl/lexer_test.cc +++ b/src/tint/reader/wgsl/lexer_test.cc @@ -1082,7 +1082,6 @@ INSTANTIATE_TEST_SUITE_P(LexerTest, TokenData{"struct", Token::Type::kStruct}, TokenData{"switch", Token::Type::kSwitch}, TokenData{"true", Token::Type::kTrue}, - TokenData{"type", Token::Type::kType}, TokenData{"var", Token::Type::kVar}, TokenData{"while", Token::Type::kWhile})); diff --git a/src/tint/reader/wgsl/parser_impl.cc b/src/tint/reader/wgsl/parser_impl.cc index e333efefe9..c4ae32e00c 100644 --- a/src/tint/reader/wgsl/parser_impl.cc +++ b/src/tint/reader/wgsl/parser_impl.cc @@ -99,10 +99,11 @@ bool is_reserved(const Token& t) { t == "signed" || t == "sizeof" || t == "smooth" || t == "snorm" || t == "static" || t == "static_cast" || t == "std" || t == "subroutine" || t == "super" || t == "target" || t == "template" || t == "this" || t == "thread_local" || t == "throw" || t == "trait" || - t == "try" || t == "typedef" || t == "typeid" || t == "typename" || t == "typeof" || - t == "union" || t == "unless" || t == "unorm" || t == "unsafe" || t == "unsized" || - t == "use" || t == "using" || t == "varying" || t == "virtual" || t == "volatile" || - t == "wgsl" || t == "where" || t == "with" || t == "writeonly" || t == "yield"; + t == "try" || t == "type" || t == "typedef" || t == "typeid" || t == "typename" || + t == "typeof" || t == "union" || t == "unless" || t == "unorm" || t == "unsafe" || + t == "unsized" || t == "use" || t == "using" || t == "varying" || t == "virtual" || + t == "volatile" || t == "wgsl" || t == "where" || t == "with" || t == "writeonly" || + t == "yield"; } /// Enter-exit counters for block token types. @@ -774,12 +775,7 @@ Maybe ParserImpl::variable_qualifier() { // : ALIAS IDENT EQUAL type_specifier Maybe ParserImpl::type_alias_decl() { Source source; - if (match(Token::Type::kAlias, &source)) { - // matched. - } else if (match(Token::Type::kType, &source)) { - // TODO(crbug.com/tint/1812): DEPRECATED - deprecated(source, "'type' has been renamed to 'alias'"); - } else { + if (!match(Token::Type::kAlias, &source)) { return Failure::kNoMatch; } diff --git a/src/tint/reader/wgsl/parser_impl_error_msg_test.cc b/src/tint/reader/wgsl/parser_impl_error_msg_test.cc index 18b40beb8f..6b92c3c9ff 100644 --- a/src/tint/reader/wgsl/parser_impl_error_msg_test.cc +++ b/src/tint/reader/wgsl/parser_impl_error_msg_test.cc @@ -52,14 +52,9 @@ fn f() { return 1 & >; } } TEST_F(ParserImplErrorTest, AliasDeclInvalidAttribute) { - EXPECT( - "@invariant type e=u32;", - R"(test.wgsl:1:12 warning: use of deprecated language feature: 'type' has been renamed to 'alias' -@invariant type e=u32; - ^^^^ - -test.wgsl:1:2 error: unexpected attributes -@invariant type e=u32; + EXPECT("@invariant alias e=u32;", + R"(test.wgsl:1:2 error: unexpected attributes +@invariant alias e=u32; ^^^^^^^^^ )"); } @@ -681,10 +676,10 @@ const_assert; } TEST_F(ParserImplErrorTest, GlobalDeclConstAssertMissingCondThenAlias) { - EXPECT("const_assert\ntype T = i32;", + EXPECT("const_assert\nalias T = i32;", R"(test.wgsl:2:1 error: unable to parse condition expression -type T = i32; -^^^^ +alias T = i32; +^^^^^ )"); } @@ -736,14 +731,14 @@ static_assert; // TODO(crbug.com/tint/1807): DEPRECATED TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclStaticAssertMissingCondThenAlias) { EXPECT( - "static_assert\ntype T = i32;", + "static_assert\nalias T = i32;", R"(test.wgsl:1:1 warning: use of deprecated language feature: 'static_assert' has been renamed to 'const_assert' static_assert ^^^^^^^^^^^^^ test.wgsl:2:1 error: unable to parse condition expression -type T = i32; -^^^^ +alias T = i32; +^^^^^ )"); } @@ -882,57 +877,6 @@ alias meow = f32 )"); } -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingIdentifier) { - EXPECT("alias 1 = f32;", - R"(test.wgsl:1:7 error: expected identifier for type alias -alias 1 = f32; - ^ -)"); -} - -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasInvalidType) { - EXPECT( - "type meow = 1;", - R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias' -type meow = 1; -^^^^ - -test.wgsl:1:13 error: invalid type alias -type meow = 1; - ^ -)"); -} - -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingAssignment) { - EXPECT( - "type meow f32", - R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias' -type meow f32 -^^^^ - -test.wgsl:1:11 error: expected '=' for type alias -type meow f32 - ^^^ -)"); -} - -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingSemicolon) { - EXPECT( - "type meow = f32", - R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias' -type meow = f32 -^^^^ - -test.wgsl:1:16 error: expected ';' for type alias -type meow = f32 - ^ -)"); -} - TEST_F(ParserImplErrorTest, GlobalDeclVarArrayMissingGreaterThan) { EXPECT("var i : arraytype, "A"); } -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias) { - auto p = parser("type A = i32;"); - p->global_decl(); - ASSERT_FALSE(p->has_error()) << p->error(); - - auto program = p->program(); - ASSERT_EQ(program.AST().TypeDecls().Length(), 1u); - ASSERT_TRUE(program.AST().TypeDecls()[0]->Is()); - ast::CheckIdentifier(program.Symbols(), program.AST().TypeDecls()[0]->As()->name, - "A"); -} - -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias_StructIdent) { - auto p = parser(R"(struct A { - a : f32, -} -type B = A;)"); - p->global_decl(); - p->global_decl(); - ASSERT_FALSE(p->has_error()) << p->error(); - - auto program = p->program(); - ASSERT_EQ(program.AST().TypeDecls().Length(), 2u); - ASSERT_TRUE(program.AST().TypeDecls()[0]->Is()); - auto* str = program.AST().TypeDecls()[0]->As(); - EXPECT_EQ(str->name->symbol, program.Symbols().Get("A")); - - ASSERT_TRUE(program.AST().TypeDecls()[1]->Is()); - auto* alias = program.AST().TypeDecls()[1]->As(); - EXPECT_EQ(alias->name->symbol, program.Symbols().Get("B")); - ast::CheckIdentifier(program.Symbols(), alias->type, "A"); -} - TEST_F(ParserImplTest, GlobalDecl_TypeAlias_MissingSemicolon) { auto p = parser("alias A = i32"); p->global_decl(); @@ -174,16 +139,6 @@ TEST_F(ParserImplTest, GlobalDecl_TypeAlias_MissingSemicolon) { EXPECT_EQ(p->error(), "1:14: expected ';' for type alias"); } -// TODO(crbug.com/tint/1812): DEPRECATED -TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias_MissingSemicolon) { - auto p = parser("type A = i32"); - p->global_decl(); - ASSERT_TRUE(p->has_error()); - EXPECT_EQ(p->error(), - R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias' -1:13: expected ';' for type alias)"); -} - TEST_F(ParserImplTest, GlobalDecl_Function) { auto p = parser("fn main() { return; }"); p->global_decl(); diff --git a/src/tint/reader/wgsl/parser_impl_reserved_keyword_test.cc b/src/tint/reader/wgsl/parser_impl_reserved_keyword_test.cc index c20302d9f5..5efd0b8a8b 100644 --- a/src/tint/reader/wgsl/parser_impl_reserved_keyword_test.cc +++ b/src/tint/reader/wgsl/parser_impl_reserved_keyword_test.cc @@ -216,6 +216,7 @@ INSTANTIATE_TEST_SUITE_P(ParserImplReservedKeywordTest, "throw", "trait", "try", + "type", "typedef", "typeid", "typename", diff --git a/src/tint/reader/wgsl/parser_impl_type_alias_test.cc b/src/tint/reader/wgsl/parser_impl_type_alias_test.cc index 1c2b4fe109..1aa8bf9500 100644 --- a/src/tint/reader/wgsl/parser_impl_type_alias_test.cc +++ b/src/tint/reader/wgsl/parser_impl_type_alias_test.cc @@ -19,7 +19,7 @@ namespace tint::reader::wgsl { namespace { TEST_F(ParserImplTest, TypeDecl_ParsesType) { - auto p = parser("type a = i32"); + auto p = parser("alias a = i32"); auto t = p->type_alias_decl(); EXPECT_FALSE(p->has_error()); @@ -29,11 +29,11 @@ TEST_F(ParserImplTest, TypeDecl_ParsesType) { ASSERT_TRUE(t->Is()); auto* alias = t->As(); ast::CheckIdentifier(p->builder().Symbols(), alias->type, "i32"); - EXPECT_EQ(t.value->source.range, (Source::Range{{1u, 1u}, {1u, 13u}})); + EXPECT_EQ(t.value->source.range, (Source::Range{{1u, 1u}, {1u, 14u}})); } TEST_F(ParserImplTest, TypeDecl_Parses_Ident) { - auto p = parser("type a = B"); + auto p = parser("alias a = B"); auto t = p->type_alias_decl(); EXPECT_FALSE(p->has_error()); @@ -44,7 +44,7 @@ TEST_F(ParserImplTest, TypeDecl_Parses_Ident) { auto* alias = t.value->As(); ast::CheckIdentifier(p->builder().Symbols(), alias->name, "a"); ast::CheckIdentifier(p->builder().Symbols(), alias->type, "B"); - EXPECT_EQ(alias->source.range, (Source::Range{{1u, 1u}, {1u, 11u}})); + EXPECT_EQ(alias->source.range, (Source::Range{{1u, 1u}, {1u, 12u}})); } TEST_F(ParserImplTest, TypeDecl_Unicode_Parses_Ident) { @@ -52,7 +52,7 @@ TEST_F(ParserImplTest, TypeDecl_Unicode_Parses_Ident) { "\xf0\x9d\x93\xb6\xf0\x9d\x94\x82\x5f\xf0\x9d\x93\xbd\xf0\x9d\x94\x82\xf0" "\x9d\x93\xb9\xf0\x9d\x93\xae"; - auto p = parser("type " + ident + " = i32"); + auto p = parser("alias " + ident + " = i32"); auto t = p->type_alias_decl(); EXPECT_FALSE(p->has_error()); @@ -63,43 +63,37 @@ TEST_F(ParserImplTest, TypeDecl_Unicode_Parses_Ident) { auto* alias = t.value->As(); ast::CheckIdentifier(p->builder().Symbols(), alias->name, ident); ast::CheckIdentifier(p->builder().Symbols(), alias->type, "i32"); - EXPECT_EQ(alias->source.range, (Source::Range{{1u, 1u}, {1u, 37u}})); + EXPECT_EQ(alias->source.range, (Source::Range{{1u, 1u}, {1u, 38u}})); } TEST_F(ParserImplTest, TypeDecl_MissingIdent) { - auto p = parser("type = i32"); + auto p = parser("alias = i32"); auto t = p->type_alias_decl(); EXPECT_TRUE(t.errored); EXPECT_FALSE(t.matched); EXPECT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); - EXPECT_EQ(p->error(), - R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias' -1:6: expected identifier for type alias)"); + EXPECT_EQ(p->error(), R"(1:7: expected identifier for type alias)"); } TEST_F(ParserImplTest, TypeDecl_InvalidIdent) { - auto p = parser("type 123 = i32"); + auto p = parser("alias 123 = i32"); auto t = p->type_alias_decl(); EXPECT_TRUE(t.errored); EXPECT_FALSE(t.matched); EXPECT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); - EXPECT_EQ(p->error(), - R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias' -1:6: expected identifier for type alias)"); + EXPECT_EQ(p->error(), R"(1:7: expected identifier for type alias)"); } TEST_F(ParserImplTest, TypeDecl_MissingEqual) { - auto p = parser("type a i32"); + auto p = parser("alias a i32"); auto t = p->type_alias_decl(); EXPECT_TRUE(t.errored); EXPECT_FALSE(t.matched); EXPECT_TRUE(p->has_error()); EXPECT_EQ(t.value, nullptr); - EXPECT_EQ(p->error(), - R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias' -1:8: expected '=' for type alias)"); + EXPECT_EQ(p->error(), R"(1:9: expected '=' for type alias)"); } } // namespace diff --git a/src/tint/reader/wgsl/token.cc b/src/tint/reader/wgsl/token.cc index 3bc2a0d9e6..5935adcde6 100644 --- a/src/tint/reader/wgsl/token.cc +++ b/src/tint/reader/wgsl/token.cc @@ -189,8 +189,6 @@ std::string_view Token::TypeToName(Type type) { return "switch"; case Token::Type::kTrue: return "true"; - case Token::Type::kType: - return "type"; case Token::Type::kVar: return "var"; case Token::Type::kWhile: diff --git a/src/tint/reader/wgsl/token.h b/src/tint/reader/wgsl/token.h index c2f08a7170..fe816a6a74 100644 --- a/src/tint/reader/wgsl/token.h +++ b/src/tint/reader/wgsl/token.h @@ -201,8 +201,6 @@ class Token { kSwitch, /// A 'true' kTrue, - /// A 'type' - kType, /// A 'var' kVar, /// A 'while' diff --git a/src/tint/transform/add_block_attribute_test.cc b/src/tint/transform/add_block_attribute_test.cc index 74dd5a9703..4a02db9679 100644 --- a/src/tint/transform/add_block_attribute_test.cc +++ b/src/tint/transform/add_block_attribute_test.cc @@ -132,7 +132,7 @@ fn main() { TEST_F(AddBlockAttributeTest, BasicArray_Alias) { auto* src = R"( -type Numbers = array, 4u>; +alias Numbers = array, 4u>; @group(0) @binding(0) var u : Numbers; @@ -693,13 +693,13 @@ struct Inner { f : f32, }; -type MyInner = Inner; +alias MyInner = Inner; struct Outer { i : MyInner, }; -type MyOuter = Outer; +alias MyOuter = Outer; @group(0) @binding(0) var u0 : MyOuter; @@ -763,12 +763,12 @@ fn main() { @group(0) @binding(1) var u1 : MyInner; -type MyInner = Inner; +alias MyInner = Inner; @group(0) @binding(0) var u0 : MyOuter; -type MyOuter = Outer; +alias MyOuter = Outer; struct Outer { i : MyInner, diff --git a/src/tint/transform/canonicalize_entry_point_io_test.cc b/src/tint/transform/canonicalize_entry_point_io_test.cc index f0ce8c34c5..db6385efc6 100644 --- a/src/tint/transform/canonicalize_entry_point_io_test.cc +++ b/src/tint/transform/canonicalize_entry_point_io_test.cc @@ -164,7 +164,7 @@ fn frag_main(tint_symbol : tint_symbol_1) { TEST_F(CanonicalizeEntryPointIOTest, Parameter_TypeAlias) { auto* src = R"( -type myf32 = f32; +alias myf32 = f32; @fragment fn frag_main(@location(1) loc1 : myf32) { @@ -204,7 +204,7 @@ fn frag_main(@location(1) loc1 : myf32) { var x : myf32 = loc1; } -type myf32 = f32; +alias myf32 = f32; )"; auto* expect = R"( @@ -1561,7 +1561,7 @@ struct FragmentInput { TEST_F(CanonicalizeEntryPointIOTest, Struct_TypeAliases) { auto* src = R"( -type myf32 = f32; +alias myf32 = f32; struct FragmentInput { @location(0) col1 : myf32, @@ -1573,9 +1573,9 @@ struct FragmentOutput { @location(1) col2 : myf32, }; -type MyFragmentInput = FragmentInput; +alias MyFragmentInput = FragmentInput; -type MyFragmentOutput = FragmentOutput; +alias MyFragmentOutput = FragmentOutput; fn foo(x : MyFragmentInput) -> myf32 { return x.col1; @@ -1653,9 +1653,9 @@ fn frag_main(inputs : MyFragmentInput) -> MyFragmentOutput { return MyFragmentOutput(x, inputs.col2); } -type MyFragmentInput = FragmentInput; +alias MyFragmentInput = FragmentInput; -type MyFragmentOutput = FragmentOutput; +alias MyFragmentOutput = FragmentOutput; fn foo(x : MyFragmentInput) -> myf32 { return x.col1; @@ -1671,7 +1671,7 @@ struct FragmentOutput { @location(1) col2 : myf32, }; -type myf32 = f32; +alias myf32 = f32; )"; auto* expect = R"( diff --git a/src/tint/transform/combine_samplers_test.cc b/src/tint/transform/combine_samplers_test.cc index e400ed53a4..cfabded090 100644 --- a/src/tint/transform/combine_samplers_test.cc +++ b/src/tint/transform/combine_samplers_test.cc @@ -232,7 +232,7 @@ fn main() -> vec4 { TEST_F(CombineSamplersTest, AliasedTypes) { auto* src = R"( -type Tex2d = texture_2d; +alias Tex2d = texture_2d; @group(0) @binding(0) var t : Tex2d; @@ -282,7 +282,7 @@ fn sample(t : Tex2d, s : sampler, coords : vec2) -> vec4 { @group(0) @binding(0) var t : Tex2d; @group(0) @binding(1) var s : sampler; -type Tex2d = texture_2d; +alias Tex2d = texture_2d; )"; auto* expect = R"( @group(0) @binding(0) @internal(disable_validation__binding_point_collision) var t_s : texture_2d; diff --git a/src/tint/transform/decompose_memory_access_test.cc b/src/tint/transform/decompose_memory_access_test.cc index f0f441f39a..0122004120 100644 --- a/src/tint/transform/decompose_memory_access_test.cc +++ b/src/tint/transform/decompose_memory_access_test.cc @@ -3401,9 +3401,9 @@ struct S1 { c : i32, }; -type A1 = S1; +alias A1 = S1; -type A1_Array = array; +alias A1_Array = array; struct S2 { a : i32, @@ -3411,9 +3411,9 @@ struct S2 { c : i32, }; -type A2 = S2; +alias A2 = S2; -type A2_Array = array; +alias A2_Array = array; struct SB { @size(128) @@ -3496,9 +3496,9 @@ struct SB { b : A2_Array, }; -type A2_Array = array; +alias A2_Array = array; -type A2 = S2; +alias A2 = S2; struct S2 { a : i32, @@ -3506,9 +3506,9 @@ struct S2 { c : i32, }; -type A1 = S1; +alias A1 = S1; -type A1_Array = array; +alias A1_Array = array; struct S1 { a : i32, diff --git a/src/tint/transform/direct_variable_access_test.cc b/src/tint/transform/direct_variable_access_test.cc index 71e7c94b68..f0176620c4 100644 --- a/src/tint/transform/direct_variable_access_test.cc +++ b/src/tint/transform/direct_variable_access_test.cc @@ -818,7 +818,7 @@ struct Inner { mat : mat3x4, }; -type InnerArr = array; +alias InnerArr = array; struct Outer { arr : InnerArr, @@ -1112,7 +1112,7 @@ struct Inner { mat : mat3x4, }; -type InnerArr = array; +alias InnerArr = array; struct Outer { arr : InnerArr, @@ -1356,7 +1356,7 @@ struct Inner { mat : mat3x4, }; -type InnerArr = array; +alias InnerArr = array; struct Outer { arr : InnerArr, @@ -1828,7 +1828,7 @@ struct Inner { mat : mat3x4, }; -type InnerArr = array; +alias InnerArr = array; struct Outer { arr : InnerArr, diff --git a/src/tint/transform/module_scope_var_to_entry_point_param_test.cc b/src/tint/transform/module_scope_var_to_entry_point_param_test.cc index 0f4c5b9d2d..a9aaa28af6 100644 --- a/src/tint/transform/module_scope_var_to_entry_point_param_test.cc +++ b/src/tint/transform/module_scope_var_to_entry_point_param_test.cc @@ -605,7 +605,7 @@ fn foo(@internal(disable_validation__ignore_address_space) @internal(disable_val TEST_F(ModuleScopeVarToEntryPointParamTest, Buffer_RuntimeArray_Alias) { auto* src = R"( -type myarray = array; +alias myarray = array; @group(0) @binding(0) var buffer : myarray; @@ -643,7 +643,7 @@ fn main() { @group(0) @binding(0) var buffer : myarray; -type myarray = array; +alias myarray = array; )"; auto* expect = R"( diff --git a/src/tint/transform/multiplanar_external_texture_test.cc b/src/tint/transform/multiplanar_external_texture_test.cc index af1d0b487a..d42b71956a 100644 --- a/src/tint/transform/multiplanar_external_texture_test.cc +++ b/src/tint/transform/multiplanar_external_texture_test.cc @@ -32,7 +32,7 @@ TEST_F(MultiplanarExternalTextureTest, ShouldRunEmptyModule) { TEST_F(MultiplanarExternalTextureTest, ShouldRunHasExternalTextureAlias) { auto* src = R"( -type ET = texture_external; +alias ET = texture_external; )"; DataMap data; @@ -1616,7 +1616,7 @@ fn f(ext_tex : texture_2d, ext_tex_plane_1 : texture_2d, ext_tex_param // Tests that the the transform handles aliases to external textures TEST_F(MultiplanarExternalTextureTest, ExternalTextureAlias) { auto* src = R"( -type ET = texture_external; +alias ET = texture_external; fn f(t : ET, s : sampler) { textureSampleBaseClampToEdge(t, s, vec2(1.0, 2.0)); @@ -1724,7 +1724,7 @@ fn f(t : ET, s : sampler) { @group(0) @binding(0) var ext_tex : ET; @group(0) @binding(1) var smp : sampler; -type ET = texture_external; +alias ET = texture_external; )"; auto* expect = R"( diff --git a/src/tint/transform/preserve_padding_test.cc b/src/tint/transform/preserve_padding_test.cc index 854b4a540a..9405210cd4 100644 --- a/src/tint/transform/preserve_padding_test.cc +++ b/src/tint/transform/preserve_padding_test.cc @@ -373,7 +373,7 @@ fn foo() { TEST_F(PreservePaddingTest, ArrayOfArray) { auto* src = R"( -type Array = array, 4>, 3>; +alias Array = array, 4>, 3>; @group(0) @binding(0) var v : Array; diff --git a/src/tint/transform/renamer_test.cc b/src/tint/transform/renamer_test.cc index a0d1d1a995..4e9e7c6872 100644 --- a/src/tint/transform/renamer_test.cc +++ b/src/tint/transform/renamer_test.cc @@ -1856,7 +1856,7 @@ TEST_P(RenamerBuiltinTypeTest, RenameShadowedByAlias) { }; auto src = expand(R"( -type $name = $other_type; +alias $name = $other_type; @fragment fn f() { diff --git a/src/tint/transform/single_entry_point_test.cc b/src/tint/transform/single_entry_point_test.cc index d0c3dd4178..f4f1dec0ca 100644 --- a/src/tint/transform/single_entry_point_test.cc +++ b/src/tint/transform/single_entry_point_test.cc @@ -416,7 +416,7 @@ TEST_F(SingleEntryPointTest, OverridableConstants_UnusedAliasForOverrideSizedArr // This is all unused by the target entry point. @id(1) override c1 : u32; -type arr_ty = array; +alias arr_ty = array; var arr : arr_ty; @compute @workgroup_size(64) diff --git a/src/tint/transform/spirv_atomic_test.cc b/src/tint/transform/spirv_atomic_test.cc index bef061cecf..7bb9f2a257 100644 --- a/src/tint/transform/spirv_atomic_test.cc +++ b/src/tint/transform/spirv_atomic_test.cc @@ -210,13 +210,13 @@ fn f() { TEST_F(SpirvAtomicTest, AliasedArraysOfU32) { auto* src = R"( -type A0 = u32; +alias A0 = u32; -type A1 = array; +alias A1 = array; -type A2 = array; +alias A2 = array; -type A3 = array; +alias A3 = array; var wg : A3; diff --git a/src/tint/transform/unshadow_test.cc b/src/tint/transform/unshadow_test.cc index ec17ff5be9..9d8541d973 100644 --- a/src/tint/transform/unshadow_test.cc +++ b/src/tint/transform/unshadow_test.cc @@ -50,7 +50,7 @@ fn F(c : i32) { TEST_F(UnshadowTest, LocalShadowsAlias) { auto* src = R"( -type a = i32; +alias a = i32; fn X() { var a = false; @@ -100,7 +100,7 @@ fn Z() { const a = true; } -type a = i32; +alias a = i32; )"; auto* expect = R"( @@ -691,7 +691,7 @@ const a : i32 = 1; TEST_F(UnshadowTest, ParamShadowsAlias) { auto* src = R"( -type a = i32; +alias a = i32; fn F(a : a) { { @@ -732,7 +732,7 @@ fn F(a : a) { } } -type a = i32; +alias a = i32; )"; auto* expect = R"( diff --git a/src/tint/transform/zero_init_workgroup_memory_test.cc b/src/tint/transform/zero_init_workgroup_memory_test.cc index c067f1bf9a..fbd753801c 100644 --- a/src/tint/transform/zero_init_workgroup_memory_test.cc +++ b/src/tint/transform/zero_init_workgroup_memory_test.cc @@ -1366,7 +1366,7 @@ struct S { TEST_F(ZeroInitWorkgroupMemoryTest, ArrayWithOverrideCount) { auto* src = R"(override O = 123; -type A = array; +alias A = array; var W : A;