mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Update namer to use symbol table.
This Cl updates the various namer objects to work off the symbol table instead of names. Change-Id: I94b00a10225d0587f037cfaa6d9b42e2a8885734 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35101 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: dan sinclair <dsinclair@chromium.org> Auto-Submit: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
591268db48
commit
1e0472cdba
@@ -81,6 +81,10 @@ Symbol Module::RegisterSymbol(const std::string& name) {
|
||||
return symbol_table_.Register(name);
|
||||
}
|
||||
|
||||
std::string Module::SymbolToName(const Symbol sym) const {
|
||||
return symbol_table_.NameFor(sym);
|
||||
}
|
||||
|
||||
bool Module::IsValid() const {
|
||||
for (auto* var : global_variables_) {
|
||||
if (var == nullptr || !var->IsValid()) {
|
||||
|
||||
@@ -169,6 +169,11 @@ class Module {
|
||||
/// previously generated symbol will be returned.
|
||||
Symbol RegisterSymbol(const std::string& name);
|
||||
|
||||
/// Returns the `name` for `sym`
|
||||
/// @param sym the symbol to retrieve the name for
|
||||
/// @returns the use provided `name` for the symbol or "" if not found
|
||||
std::string SymbolToName(const Symbol sym) const;
|
||||
|
||||
private:
|
||||
Module(const Module&) = delete;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user