Internals: Fix number nodep cloning, and assert stays consistent (#4528 partial)

This commit is contained in:
Wilson Snyder 2023-10-01 12:46:35 -04:00
parent 44e7d2ebe6
commit 33787c6add
2 changed files with 6 additions and 0 deletions

View File

@ -1053,6 +1053,11 @@ public:
const AstConst* const sp = static_cast<const AstConst*>(samep);
return num().isCaseEq(sp->num());
}
void cloneRelink() override { m_num.nodep(this); }
const char* broken() const override {
BROKEN_RTN(m_num.nodep() && m_num.nodep() != this);
return nullptr;
}
int instrCount() const override { return widthInstrs(); }
bool isEqAllOnes() const { return num().isEqAllOnes(width()); }
bool isEqAllOnesV() const { return num().isEqAllOnes(widthMinV()); }

View File

@ -357,6 +357,7 @@ class V3Number final {
public:
void nodep(AstNode* nodep) VL_MT_STABLE;
AstNode* nodep() const VL_MT_SAFE { return m_nodep; } // For debug only
FileLine* fileline() const VL_MT_SAFE { return m_fileline; }
V3Number& setZero();
V3Number& setQuad(uint64_t value);