transforms: Add a ProgramBuilder::Sym() helper

This creates a new, unnamed symbol.

Change-Id: I0ea11e812296c3215ba624a18777d3e7233e2ae4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49441
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-04-29 12:59:14 +00:00
committed by Commit Bot service account
parent 77f7f5d369
commit 65ae64d009
9 changed files with 26 additions and 24 deletions

View File

@@ -878,6 +878,9 @@ class ProgramBuilder {
// AST helper methods
//////////////////////////////////////////////////////////////////////////////
/// @return a new unnamed symbol
Symbol Sym() { return Symbols().New(); }
/// @param name the symbol string
/// @return a Symbol with the given name
Symbol Sym(const std::string& name) { return Symbols().Register(name); }