astgen: Enforce the use of aliased operand accessors (#4688)

This patch enforces the use of the most specific accessors for operands
which have an '@astgen alias' declaration, by making the superclass
accessors of the same operands private. This ensures client code is
cleaner as you can't use multiple different methods to reference the
same operands (which we used to in some places). Also prep for some
refactoring.
This commit is contained in:
Geza Lore
2023-11-12 18:30:48 +00:00
committed by GitHub
parent 1c0af6c7bc
commit 47588f343b
13 changed files with 106 additions and 86 deletions
+5 -5
View File
@@ -238,19 +238,19 @@ private:
void visit(AstSel* nodep) override {
VL_RESTORER(m_setRefLvalue);
{
iterateAndNextNull(nodep->lhsp());
iterateAndNextNull(nodep->fromp());
// Only set lvalues on the from
m_setRefLvalue = VAccess::NOCHANGE;
iterateAndNextNull(nodep->rhsp());
iterateAndNextNull(nodep->thsp());
iterateAndNextNull(nodep->lsbp());
iterateAndNextNull(nodep->widthp());
}
}
void visit(AstNodeSel* nodep) override {
VL_RESTORER(m_setRefLvalue);
{ // Only set lvalues on the from
iterateAndNextNull(nodep->lhsp());
iterateAndNextNull(nodep->fromp());
m_setRefLvalue = VAccess::NOCHANGE;
iterateAndNextNull(nodep->rhsp());
iterateAndNextNull(nodep->bitp());
}
}
void visit(AstCellArrayRef* nodep) override {