diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index f3cc7ada8..2b985df40 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -342,7 +342,7 @@ bool RTLIL::Const::operator !=(const RTLIL::Const &other) const return !(*this == other); } -std::vector& RTLIL::Const::bits() +std::vector& RTLIL::Const::bits_internal() { bitvectorize(); return get_bits(); diff --git a/kernel/rtlil.h b/kernel/rtlil.h index d3392df8d..2ffb56052 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -738,6 +738,8 @@ private: bitvectype& get_bits() const; std::string& get_str() const; + std::vector& bits_internal(); + public: Const() : flags(RTLIL::CONST_FLAG_NONE), tag(backing_tag::bits), bits_(std::vector()) {} Const(const std::string &str); @@ -765,7 +767,8 @@ public: bool operator ==(const RTLIL::Const &other) const; bool operator !=(const RTLIL::Const &other) const; - std::vector& bits(); + [[deprecated]] + std::vector& bits() { return bits_internal(); } bool as_bool() const; // Convert the constant value to a C++ int. @@ -798,10 +801,10 @@ public: void append(const RTLIL::Const &other); void set(int i, RTLIL::State state) { - bits()[i] = state; + bits_internal()[i] = state; } void resize(int size, RTLIL::State fill) { - bits().resize(size, fill); + bits_internal().resize(size, fill); } class const_iterator {