tint/ast: Change Function::symbol to Function::name
Function::name is an ast::Identifier.
The goal here is to have all AST nodes use an identifier instead of
symbols directly. This will greatly simplify the renamer transform,
and gives the symbol a Source location, which is helpful for
diagnostics and tooling.
Change-Id: I723a9a104668758db2cb32051efa1f6d3c105913
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119280
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
diff --git a/src/tint/resolver/dependency_graph.cc b/src/tint/resolver/dependency_graph.cc
index 7326f81..c07eb0d 100644
--- a/src/tint/resolver/dependency_graph.cc
+++ b/src/tint/resolver/dependency_graph.cc
@@ -195,7 +195,7 @@
TraverseType(alias->type);
},
[&](const ast::Function* func) {
- Declare(func->symbol, func);
+ Declare(func->name->symbol, func);
TraverseFunction(func);
},
[&](const ast::Variable* var) {
@@ -559,7 +559,7 @@
return Switch(
node, //
[&](const ast::TypeDecl* td) { return td->name; },
- [&](const ast::Function* func) { return func->symbol; },
+ [&](const ast::Function* func) { return func->name->symbol; },
[&](const ast::Variable* var) { return var->symbol; },
[&](const ast::DiagnosticDirective*) { return Symbol(); },
[&](const ast::Enable*) { return Symbol(); },