diff --git a/src/ast/unary_op.cc b/src/ast/unary_op.cc index 1b60c5c667..3e36f08f13 100644 --- a/src/ast/unary_op.cc +++ b/src/ast/unary_op.cc @@ -23,8 +23,8 @@ std::ostream& operator<<(std::ostream& out, UnaryOp mod) { out << "address-of"; break; } - case UnaryOp::kDereference: { - out << "dereference"; + case UnaryOp::kIndirection: { + out << "indirection"; break; } case UnaryOp::kNegation: { diff --git a/src/ast/unary_op.h b/src/ast/unary_op.h index f4352e690a..c2c0801025 100644 --- a/src/ast/unary_op.h +++ b/src/ast/unary_op.h @@ -23,7 +23,7 @@ namespace ast { /// The unary op enum class UnaryOp { kAddressOf, // &EXPR - kDereference, // *EXPR + kIndirection, // *EXPR kNegation, // -EXPR kNot, // !EXPR }; diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 88618fef32..9398034971 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -2325,7 +2325,7 @@ Maybe ParserImpl::unary_expression() { } else if (match(Token::Type::kBang)) { op = ast::UnaryOp::kNot; } else if (match(Token::Type::kStar)) { - op = ast::UnaryOp::kDereference; + op = ast::UnaryOp::kIndirection; } else if (match(Token::Type::kAnd)) { op = ast::UnaryOp::kAddressOf; } else { diff --git a/src/reader/wgsl/parser_impl_unary_expression_test.cc b/src/reader/wgsl/parser_impl_unary_expression_test.cc index 047060df88..54907652d2 100644 --- a/src/reader/wgsl/parser_impl_unary_expression_test.cc +++ b/src/reader/wgsl/parser_impl_unary_expression_test.cc @@ -85,7 +85,7 @@ TEST_F(ParserImplTest, UnaryExpression_Dereference) { ASSERT_TRUE(e->Is()); auto* u = e->As(); - EXPECT_EQ(u->op(), ast::UnaryOp::kDereference); + EXPECT_EQ(u->op(), ast::UnaryOp::kIndirection); EXPECT_TRUE(u->expr()->Is()); } @@ -113,7 +113,7 @@ TEST_F(ParserImplTest, UnaryExpression_Dereference_Precedence) { ASSERT_TRUE(e->Is()); auto* u = e->As(); - EXPECT_EQ(u->op(), ast::UnaryOp::kDereference); + EXPECT_EQ(u->op(), ast::UnaryOp::kIndirection); EXPECT_TRUE(u->expr()->Is()); } diff --git a/src/transform/hlsl.cc b/src/transform/hlsl.cc index 65ed1cad69..c712e9c11d 100644 --- a/src/transform/hlsl.cc +++ b/src/transform/hlsl.cc @@ -129,7 +129,7 @@ void Hlsl::AddEmptyEntryPoint(CloneContext& ctx) const { return; } } - ctx.dst->Func(ctx.dst->Symbols().New("tint_unused_entry_point"), {}, + ctx.dst->Func(ctx.dst->Symbols().New("unused_entry_point"), {}, ctx.dst->ty.void_(), {}, {ctx.dst->Stage(ast::PipelineStage::kCompute)}); } diff --git a/src/transform/hlsl_test.cc b/src/transform/hlsl_test.cc index c14422527a..b49878f46a 100644 --- a/src/transform/hlsl_test.cc +++ b/src/transform/hlsl_test.cc @@ -282,7 +282,7 @@ TEST_F(HlslTest, AddEmptyEntryPoint) { auto* expect = R"( [[stage(compute)]] -fn tint_unused_entry_point() { +fn unused_entry_point() { } )"; diff --git a/src/transform/spirv.cc b/src/transform/spirv.cc index b5db367cd9..20bdf68c72 100644 --- a/src/transform/spirv.cc +++ b/src/transform/spirv.cc @@ -285,7 +285,7 @@ void Spirv::AddEmptyEntryPoint(CloneContext& ctx) const { return; } } - ctx.dst->Func("_tint_unused_entry_point", {}, ctx.dst->ty.void_(), {}, + ctx.dst->Func(ctx.dst->Sym("unused_entry_point"), {}, ctx.dst->ty.void_(), {}, {ctx.dst->Stage(ast::PipelineStage::kCompute)}); } diff --git a/src/transform/spirv_test.cc b/src/transform/spirv_test.cc index ca1fe7d8e8..a3ca841aa6 100644 --- a/src/transform/spirv_test.cc +++ b/src/transform/spirv_test.cc @@ -693,7 +693,7 @@ TEST_F(SpirvTest, AddEmptyEntryPoint) { auto* expect = R"( [[stage(compute)]] -fn _tint_unused_entry_point() { +fn unused_entry_point() { } )"; diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 7b7ce20cc4..ce0a78b9f2 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -2599,7 +2599,7 @@ bool GeneratorImpl::EmitUnaryOp(std::ostream& pre, std::ostream& out, ast::UnaryOpExpression* expr) { switch (expr->op()) { - case ast::UnaryOp::kDereference: + case ast::UnaryOp::kIndirection: case ast::UnaryOp::kAddressOf: // TODO(crbug.com/tint/183) - support pointers return EmitExpression(pre, out, expr->expr()); diff --git a/src/writer/hlsl/generator_impl_unary_op_test.cc b/src/writer/hlsl/generator_impl_unary_op_test.cc index 97ea2a4885..e6c6441b09 100644 --- a/src/writer/hlsl/generator_impl_unary_op_test.cc +++ b/src/writer/hlsl/generator_impl_unary_op_test.cc @@ -46,7 +46,7 @@ INSTANTIATE_TEST_SUITE_P( HlslGeneratorImplTest_UnaryOp, HlslUnaryOpTest, testing::Values(UnaryOpData{"", ast::UnaryOp::kAddressOf}, - UnaryOpData{"", ast::UnaryOp::kDereference}, + UnaryOpData{"", ast::UnaryOp::kIndirection}, UnaryOpData{"!", ast::UnaryOp::kNot}, UnaryOpData{"-", ast::UnaryOp::kNegation})); diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index 79296e5585..aa47e1ff70 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -2151,12 +2151,12 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { bool GeneratorImpl::EmitUnaryOp(ast::UnaryOpExpression* expr) { switch (expr->op()) { - case ast::UnaryOp::kDereference: - out_ << "*"; - break; case ast::UnaryOp::kAddressOf: out_ << "&"; break; + case ast::UnaryOp::kIndirection: + out_ << "*"; + break; case ast::UnaryOp::kNot: out_ << "!"; break; diff --git a/src/writer/msl/generator_impl_unary_op_test.cc b/src/writer/msl/generator_impl_unary_op_test.cc index 69e5ff480b..e43f31b471 100644 --- a/src/writer/msl/generator_impl_unary_op_test.cc +++ b/src/writer/msl/generator_impl_unary_op_test.cc @@ -44,7 +44,7 @@ INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, MslUnaryOpTest, testing::Values(UnaryOpData{"&", ast::UnaryOp::kAddressOf}, - UnaryOpData{"*", ast::UnaryOp::kDereference}, + UnaryOpData{"*", ast::UnaryOp::kIndirection}, UnaryOpData{"!", ast::UnaryOp::kNot}, UnaryOpData{"-", ast::UnaryOp::kNegation})); diff --git a/src/writer/wgsl/generator_impl.cc b/src/writer/wgsl/generator_impl.cc index 7317829ec3..a9607b2e01 100644 --- a/src/writer/wgsl/generator_impl.cc +++ b/src/writer/wgsl/generator_impl.cc @@ -709,12 +709,12 @@ bool GeneratorImpl::EmitBinary(ast::BinaryExpression* expr) { bool GeneratorImpl::EmitUnaryOp(ast::UnaryOpExpression* expr) { switch (expr->op()) { - case ast::UnaryOp::kDereference: - out_ << "*"; - break; case ast::UnaryOp::kAddressOf: out_ << "&"; break; + case ast::UnaryOp::kIndirection: + out_ << "*"; + break; case ast::UnaryOp::kNot: out_ << "!"; break; diff --git a/src/writer/wgsl/generator_impl_unary_op_test.cc b/src/writer/wgsl/generator_impl_unary_op_test.cc index 42d3a9dff4..62eb7f5a3b 100644 --- a/src/writer/wgsl/generator_impl_unary_op_test.cc +++ b/src/writer/wgsl/generator_impl_unary_op_test.cc @@ -48,7 +48,7 @@ INSTANTIATE_TEST_SUITE_P( WgslGeneratorImplTest, WgslUnaryOpTest, testing::Values(UnaryOpData{"&", ast::UnaryOp::kAddressOf}, - UnaryOpData{"*", ast::UnaryOp::kDereference}, + UnaryOpData{"*", ast::UnaryOp::kIndirection}, UnaryOpData{"!", ast::UnaryOp::kNot}, UnaryOpData{"-", ast::UnaryOp::kNegation}));