Global tweaks to handle having no sem::Type

Soon, we'll start migrating the AST from using sem::Types to ast::Types.
This change fixes up a bunch of places that makes the assumption that the semantic type is always expected.

Bug: tint:724
Change-Id: I96096bdf7177751ca6c6240e1739244cbeb82761
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49348
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton
2021-04-28 14:31:23 +00:00
committed by Commit Bot service account
parent 2ac55febf5
commit f5f311e264
8 changed files with 46 additions and 35 deletions

View File

@@ -173,7 +173,8 @@ class InspectorHelper : public ProgramBuilder {
/// @param type type of member
/// @returns a string for the member
std::string StructMemberName(size_t idx, typ::Type type) {
return std::to_string(idx) + type->type_name();
return std::to_string(idx) +
(type.sem ? type.sem->type_name() : type.ast->type_name());
}
/// Generates a struct type