From 6a1bf00490f9dc04655fa7832e7313b5a9e240e2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 27 Apr 2022 11:32:55 +0200 Subject: [PATCH] Remove unused `{find_,}enumeration_for_name()` methods There are no users for the `NetScope::find_enumeration_for_name()` and `Definitons::enumeration_for_name()` methods. Remove both of them. The last user was removed in commit 61a088fa78c9 ("Use elaborate_type() infrastructure to elaborate signal types"). Signed-off-by: Lars-Peter Clausen --- net_scope.cc | 36 ------------------------------------ netlist.h | 8 -------- 2 files changed, 44 deletions(-) diff --git a/net_scope.cc b/net_scope.cc index 2e6a60366..70791f094 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -76,17 +76,6 @@ netenum_t* Definitions::enumeration_for_key(const enum_type_t*key) const return 0; } -/* - * This locates the enumeration TYPE for the given enumeration literal. - */ -const netenum_t*Definitions::enumeration_for_name(perm_string name) -{ - NetEConstEnum*tmp = enum_names_[name]; - assert(tmp != 0); - - return tmp->enumeration(); -} - /* * This locates the VALUE for the given enumeration literal. */ @@ -272,31 +261,6 @@ NetScope*NetScope::find_typedef_scope(const Design*des, data_type_t*type) return 0; } -/* - * Look for the enumeration in the current scope and any parent scopes. - */ -const netenum_t*NetScope::find_enumeration_for_name(const Design*des, perm_string name) -{ - NetScope *cur_scope = this; - while (cur_scope) { - NetEConstEnum*tmp = cur_scope->enum_names_[name]; - if (tmp) break; - NetScope*import_scope = cur_scope->find_import(des, name); - if (import_scope) - cur_scope = import_scope; - else if (cur_scope == unit_) - return 0; - else - cur_scope = cur_scope->parent(); - - if (cur_scope == 0) - cur_scope = unit_; - } - - assert(cur_scope); - return cur_scope->enum_names_[name]->enumeration(); -} - /* * Attach to the a parameter name in the scope a value and a type. The value * (val_expr) is the PExpr form that is not yet elaborated. Later, when diff --git a/netlist.h b/netlist.h index 7fa85845a..feac50348 100644 --- a/netlist.h +++ b/netlist.h @@ -886,10 +886,6 @@ class Definitions { bool add_enumeration_name(netenum_t*enum_set, perm_string enum_name); - // Look up the enumeration literal in this scope. if the name - // is present, then return the enumeration type that declares it. - const netenum_t* enumeration_for_name(perm_string name); - // Look up the enumeration set that was added with the given // key. This is used by enum_type_t::elaborate_type to locate // a previously elaborated enumeration. @@ -949,10 +945,6 @@ class NetScope : public Definitions, public Attrib { /* Search the scope hierarchy for the scope where 'type' was defined. */ NetScope*find_typedef_scope(const Design*des, data_type_t*type); - /* Routine to search for the enumeration given a name. It basically - * does what enumeration_for_name() does but searched the hierarchy. */ - const netenum_t*find_enumeration_for_name(const Design*des, perm_string name); - /* Parameters exist within a scope, and these methods allow one to manipulate the set. In these cases, the name is the *simple* name of the parameter, the hierarchy is implicit in