diff --git a/src/ast/type/alias_type.h b/src/ast/type/alias_type.h index d90a99eba6..7fd0a3035e 100644 --- a/src/ast/type/alias_type.h +++ b/src/ast/type/alias_type.h @@ -39,8 +39,6 @@ class Alias : public Castable { /// @returns the alias symbol Symbol symbol() const { return symbol_; } - /// @returns the alias name - const std::string& name() const { return name_; } /// @returns the alias type Type* type() const { return subtype_; } diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 051e81f6f8..e7f957d4a8 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -238,7 +238,7 @@ bool GeneratorImpl::EmitConstructedType(std::ostream& out, // HLSL typedef is for intrinsic types only. For an alias'd struct, // generate a secondary struct with the new name. if (auto* str = alias->type()->As()) { - if (!EmitStructType(out, str, alias->name())) { + if (!EmitStructType(out, str, namer_->NameFor(alias->symbol()))) { return false; } return true; diff --git a/src/writer/wgsl/generator_impl.cc b/src/writer/wgsl/generator_impl.cc index 09509b447c..c8f868fbcd 100644 --- a/src/writer/wgsl/generator_impl.cc +++ b/src/writer/wgsl/generator_impl.cc @@ -175,7 +175,7 @@ bool GeneratorImpl::GenerateEntryPoint(ast::PipelineStage stage, bool GeneratorImpl::EmitConstructedType(const ast::type::Type* ty) { make_indent(); if (auto* alias = ty->As()) { - out_ << "type " << alias->name() << " = "; + out_ << "type " << module_.SymbolToName(alias->symbol()) << " = "; if (!EmitType(alias->type())) { return false; } @@ -414,7 +414,7 @@ bool GeneratorImpl::EmitType(ast::type::Type* type) { return false; } } else if (auto* alias = type->As()) { - out_ << alias->name(); + out_ << module_.SymbolToName(alias->symbol()); } else if (auto* ary = type->As()) { for (auto* deco : ary->decorations()) { if (auto* stride = deco->As()) {