From 55a5ba3d5a421b18803cf42b95bf6ae1c9272ebd Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 12 Jun 2022 19:26:18 +0200 Subject: [PATCH] Remove unnecessary overrides of `NetExpr::has_width()` The default implementation of the virtual method `NetExpr::has_width()` returns true. There are a few classes that directly inherit from NetExpr that override the method with the exact same implementation. Remove these. Signed-off-by: Lars-Peter Clausen --- net_expr.cc | 15 --------------- netlist.h | 5 ----- 2 files changed, 20 deletions(-) diff --git a/net_expr.cc b/net_expr.cc index bffe3d05e..db163e84a 100644 --- a/net_expr.cc +++ b/net_expr.cc @@ -250,11 +250,6 @@ ivl_variable_type_t NetEConcat::expr_type() const return expr_type_; } -bool NetEConcat::has_width() const -{ - return true; -} - void NetEConcat::set(unsigned idx, NetExpr*e) { assert(idx < parms_.size()); @@ -294,11 +289,6 @@ const verireal& NetECReal::value() const return value_; } -bool NetECReal::has_width() const -{ - return true; -} - ivl_variable_type_t NetECReal::expr_type() const { return IVL_VT_REAL; @@ -473,11 +463,6 @@ const netenum_t* NetESelect::enumeration() const return dynamic_cast (use_type_); } -bool NetESelect::has_width() const -{ - return true; -} - NetESFunc::NetESFunc(const char*n, ivl_variable_type_t t, unsigned width, unsigned np, bool is_overridden) : name_(0), type_(t), enum_type_(0), parms_(np), is_overridden_(is_overridden) diff --git a/netlist.h b/netlist.h index feac50348..28d75c2e1 100644 --- a/netlist.h +++ b/netlist.h @@ -2187,9 +2187,6 @@ class NetECReal : public NetExpr { const verireal&value() const; - // This type has no self-determined width. This is false. - virtual bool has_width() const; - // The type of this expression is ET_REAL ivl_variable_type_t expr_type() const; @@ -4401,7 +4398,6 @@ class NetEConcat : public NetExpr { virtual ivl_variable_type_t expr_type() const; virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual bool has_width() const; virtual NetEConcat* dup_expr() const; virtual NetEConst* eval_tree(); virtual NetExpr* evaluate_function(const LineInfo&loc, @@ -4458,7 +4454,6 @@ class NetESelect : public NetExpr { virtual NexusSet* nex_input(bool rem_out = true, bool always_sens = false, bool nested_func = false) const; - virtual bool has_width() const; virtual void expr_scan(struct expr_scan_t*) const; virtual NetEConst* eval_tree(); virtual NetExpr*evaluate_function(const LineInfo&loc,