Remove more uses of AST to_str() and type_name()

These methods are going to be removed as they provide little benefit over the WGSL form, are a maintainance burden and they massively bloat our codebase.

This change introduces sem::CallTargetSignature, which can be used as a std::unordered_map key.
This is used in writer/spirv to replace a map that was keyed off ast::Function::type_name().

Bug: tint:1225
Change-Id: Ic220b3155011f21b14d49eecc8042001148e4ca5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66443
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-10-14 21:17:29 +00:00
committed by Tint LUCI CQ
parent 11ed0db30d
commit 1364f202da
13 changed files with 156 additions and 79 deletions

View File

@@ -208,14 +208,11 @@ struct Robustness::State {
// Indices of the mandatory texture and coords parameters, and the optional
// array and level parameters.
auto texture_idx =
sem::IndexOf(intrinsic->Parameters(), sem::ParameterUsage::kTexture);
auto coords_idx =
sem::IndexOf(intrinsic->Parameters(), sem::ParameterUsage::kCoords);
auto array_idx =
sem::IndexOf(intrinsic->Parameters(), sem::ParameterUsage::kArrayIndex);
auto level_idx =
sem::IndexOf(intrinsic->Parameters(), sem::ParameterUsage::kLevel);
auto& signature = intrinsic->Signature();
auto texture_idx = signature.IndexOf(sem::ParameterUsage::kTexture);
auto coords_idx = signature.IndexOf(sem::ParameterUsage::kCoords);
auto array_idx = signature.IndexOf(sem::ParameterUsage::kArrayIndex);
auto level_idx = signature.IndexOf(sem::ParameterUsage::kLevel);
auto* texture_arg = expr->args()[texture_idx];
auto* coords_arg = expr->args()[coords_idx];