diff --git a/src/transform/bound_array_accessors_test.cc b/src/transform/bound_array_accessors_test.cc index c5bef53b9e..67a831cf3f 100644 --- a/src/transform/bound_array_accessors_test.cc +++ b/src/transform/bound_array_accessors_test.cc @@ -43,7 +43,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -73,7 +73,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -95,7 +95,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -121,7 +121,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -143,7 +143,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -165,7 +165,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -187,7 +187,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -213,7 +213,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -235,7 +235,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -261,7 +261,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -286,7 +286,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -308,7 +308,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -330,7 +330,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -352,7 +352,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -378,7 +378,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -404,7 +404,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -426,7 +426,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -448,7 +448,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -470,7 +470,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -492,7 +492,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -559,7 +559,7 @@ fn f() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } diff --git a/src/transform/emit_vertex_point_size_test.cc b/src/transform/emit_vertex_point_size_test.cc index 5fc7dbae99..4d4e5ed859 100644 --- a/src/transform/emit_vertex_point_size_test.cc +++ b/src/transform/emit_vertex_point_size_test.cc @@ -52,7 +52,7 @@ fn non_entry_b() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -85,7 +85,7 @@ fn non_entry_b() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -111,7 +111,7 @@ fn compute_entry() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } diff --git a/src/transform/first_index_offset_test.cc b/src/transform/first_index_offset_test.cc index 3370cf4a7e..ef8965b5af 100644 --- a/src/transform/first_index_offset_test.cc +++ b/src/transform/first_index_offset_test.cc @@ -47,7 +47,7 @@ fn entry() -> void { transforms.emplace_back(std::make_unique(0, 0)); transforms.emplace_back(std::make_unique(1, 1)); - auto got = Transform(src, std::move(transforms)); + auto got = Run(src, std::move(transforms)); EXPECT_EQ(expect, str(got)); @@ -64,7 +64,7 @@ TEST_F(FirstIndexOffsetTest, EmptyModule) { auto* src = ""; auto* expect = ""; - auto got = Transform(src, 0, 0); + auto got = Run(src, 0, 0); EXPECT_EQ(expect, str(got)); @@ -112,7 +112,7 @@ fn entry() -> void { } )"; - auto got = Transform(src, 1, 2); + auto got = Run(src, 1, 2); EXPECT_EQ(expect, str(got)); @@ -160,7 +160,7 @@ fn entry() -> void { } )"; - auto got = Transform(src, 1, 7); + auto got = Run(src, 1, 7); EXPECT_EQ(expect, str(got)); @@ -213,7 +213,7 @@ fn entry() -> void { } )"; - auto got = Transform(src, 1, 2); + auto got = Run(src, 1, 2); EXPECT_EQ(expect, str(got)); @@ -269,7 +269,7 @@ fn entry() -> void { } )"; - auto got = Transform(src, 1, 2); + auto got = Run(src, 1, 2); EXPECT_EQ(expect, str(got)); diff --git a/src/transform/hlsl_test.cc b/src/transform/hlsl_test.cc index b05fdba0ed..f0d81bdbd5 100644 --- a/src/transform/hlsl_test.cc +++ b/src/transform/hlsl_test.cc @@ -46,7 +46,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -69,7 +69,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -86,7 +86,7 @@ const module_arr : array = array(0.0, 1.0, 2.0, 3.0); auto* expect = src; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -138,7 +138,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } diff --git a/src/transform/msl.cc b/src/transform/msl.cc index 96f5f04a48..3733d1046a 100644 --- a/src/transform/msl.cc +++ b/src/transform/msl.cc @@ -320,7 +320,7 @@ void Msl::HandleEntryPointIOTypes(CloneContext& ctx) const { } auto* deco = param->decorations()[0]; - if (auto* builtin = deco->As()) { + if (deco->Is()) { // Keep any builtin-decorated parameters unchanged. builtins.insert(param); continue; diff --git a/src/transform/msl_test.cc b/src/transform/msl_test.cc index 915d591aac..c6da8c980c 100644 --- a/src/transform/msl_test.cc +++ b/src/transform/msl_test.cc @@ -55,7 +55,7 @@ fn _tint_main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -79,7 +79,7 @@ fn _tint_main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -354,7 +354,7 @@ fn frag_main(tint_symbol_4 : tint_symbol_3, [[builtin(frag_coord)]] coord : vec4 } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -396,7 +396,7 @@ fn frag_main(tint_symbol_4 : tint_symbol_3, [[builtin(frag_coord)]] coord : vec4 } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } diff --git a/src/transform/renamer_test.cc b/src/transform/renamer_test.cc index 2b3b039f49..887cfaafa9 100644 --- a/src/transform/renamer_test.cc +++ b/src/transform/renamer_test.cc @@ -29,7 +29,7 @@ TEST_F(RenamerTest, EmptyModule) { auto* src = ""; auto* expect = ""; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); @@ -65,7 +65,7 @@ fn _tint_3() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); @@ -101,7 +101,7 @@ fn _tint_1() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); @@ -134,7 +134,7 @@ fn _tint_1() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); diff --git a/src/transform/spirv_test.cc b/src/transform/spirv_test.cc index 2e66ce2dc6..f85e3188e4 100644 --- a/src/transform/spirv_test.cc +++ b/src/transform/spirv_test.cc @@ -57,7 +57,7 @@ fn compute_main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -89,7 +89,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -133,7 +133,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } @@ -164,7 +164,7 @@ fn main() -> void { } )"; - auto got = Transform(src); + auto got = Run(src); EXPECT_EQ(expect, str(got)); } diff --git a/src/transform/test_helper.h b/src/transform/test_helper.h index aa6ae963fe..f8fc8b5306 100644 --- a/src/transform/test_helper.h +++ b/src/transform/test_helper.h @@ -37,7 +37,7 @@ class TransformTestBase : public BASE { /// @param in the input WGSL source /// @param transforms the list of transforms to apply /// @return the transformed output - Transform::Output Transform( + Transform::Output Run( std::string in, std::vector> transforms) { auto file = std::make_unique("test", in); @@ -62,11 +62,11 @@ class TransformTestBase : public BASE { /// @param transform the transform to apply /// @param in the input WGSL source /// @return the transformed output - Transform::Output Transform(std::string in, - std::unique_ptr transform) { + Transform::Output Run(std::string in, + std::unique_ptr transform) { std::vector> transforms; transforms.emplace_back(std::move(transform)); - return Transform(std::move(in), std::move(transforms)); + return Run(std::move(in), std::move(transforms)); } /// Transforms and returns the WGSL source `in`, transformed using @@ -75,9 +75,9 @@ class TransformTestBase : public BASE { /// @param args the TRANSFORM constructor arguments /// @return the transformed output template - Transform::Output Transform(std::string in, ARGS&&... args) { - return Transform(std::move(in), - std::make_unique(std::forward(args)...)); + Transform::Output Run(std::string in, ARGS&&... args) { + return Run(std::move(in), + std::make_unique(std::forward(args)...)); } /// @param output the output of the transform diff --git a/src/transform/vertex_pulling_test.cc b/src/transform/vertex_pulling_test.cc index b4e1080d96..d36dcaaf9f 100644 --- a/src/transform/vertex_pulling_test.cc +++ b/src/transform/vertex_pulling_test.cc @@ -33,7 +33,7 @@ TEST_F(VertexPullingTest, Error_NoEntryPoint) { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -51,7 +51,7 @@ fn main() -> void {} auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -69,7 +69,7 @@ fn main() -> void {} auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -99,7 +99,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -141,7 +141,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -183,7 +183,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -226,7 +226,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -290,7 +290,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -339,7 +339,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } @@ -398,7 +398,7 @@ fn main() -> void { auto transform = std::make_unique(cfg); - auto got = Transform(src, std::move(transform)); + auto got = Run(src, std::move(transform)); EXPECT_EQ(expect, str(got)); } diff --git a/src/validator/validator_decoration_test.cc b/src/validator/validator_decoration_test.cc index b4dc099a46..58ab2d5576 100644 --- a/src/validator/validator_decoration_test.cc +++ b/src/validator/validator_decoration_test.cc @@ -75,6 +75,7 @@ ast::Decoration* createDecoration(ProgramBuilder& builder, case DecorationKind::kConstantId: return builder.create(0u); } + return nullptr; } using ArrayDecorationTest = ValidatorDecorationsTestWithParams;