mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-13 13:11:27 +00:00
Deprecate Const::bits()
This commit is contained in:
parent
f9ee5e4c31
commit
e41bf86cc3
2 changed files with 7 additions and 4 deletions
|
@ -342,7 +342,7 @@ bool RTLIL::Const::operator !=(const RTLIL::Const &other) const
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<RTLIL::State>& RTLIL::Const::bits()
|
std::vector<RTLIL::State>& RTLIL::Const::bits_internal()
|
||||||
{
|
{
|
||||||
bitvectorize();
|
bitvectorize();
|
||||||
return get_bits();
|
return get_bits();
|
||||||
|
|
|
@ -738,6 +738,8 @@ private:
|
||||||
|
|
||||||
bitvectype& get_bits() const;
|
bitvectype& get_bits() const;
|
||||||
std::string& get_str() const;
|
std::string& get_str() const;
|
||||||
|
std::vector<RTLIL::State>& bits_internal();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Const() : flags(RTLIL::CONST_FLAG_NONE), tag(backing_tag::bits), bits_(std::vector<RTLIL::State>()) {}
|
Const() : flags(RTLIL::CONST_FLAG_NONE), tag(backing_tag::bits), bits_(std::vector<RTLIL::State>()) {}
|
||||||
Const(const std::string &str);
|
Const(const std::string &str);
|
||||||
|
@ -765,7 +767,8 @@ public:
|
||||||
bool operator ==(const RTLIL::Const &other) const;
|
bool operator ==(const RTLIL::Const &other) const;
|
||||||
bool operator !=(const RTLIL::Const &other) const;
|
bool operator !=(const RTLIL::Const &other) const;
|
||||||
|
|
||||||
std::vector<RTLIL::State>& bits();
|
[[deprecated]]
|
||||||
|
std::vector<RTLIL::State>& bits() { return bits_internal(); }
|
||||||
bool as_bool() const;
|
bool as_bool() const;
|
||||||
|
|
||||||
// Convert the constant value to a C++ int.
|
// Convert the constant value to a C++ int.
|
||||||
|
@ -798,10 +801,10 @@ public:
|
||||||
|
|
||||||
void append(const RTLIL::Const &other);
|
void append(const RTLIL::Const &other);
|
||||||
void set(int i, RTLIL::State state) {
|
void set(int i, RTLIL::State state) {
|
||||||
bits()[i] = state;
|
bits_internal()[i] = state;
|
||||||
}
|
}
|
||||||
void resize(int size, RTLIL::State fill) {
|
void resize(int size, RTLIL::State fill) {
|
||||||
bits().resize(size, fill);
|
bits_internal().resize(size, fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
class const_iterator {
|
class const_iterator {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue