astgen: generate type specific addNext, remove astNextNull

Generate type specific static overloads of Ast<Node>::addNext, which
return the correct sub-type of the 'this' they were invoked on.

Also remove AstNode::addNextNull, which is now only used in the parser,
implement in verilog.y directly as a template function.
This commit is contained in:
Geza Lore
2022-09-17 15:05:22 +01:00
parent 79be097e34
commit 7d88e63bab
14 changed files with 142 additions and 160 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ class SliceVisitor final : public VNVisitor {
cloneAndSel(nodep->rhsp(), elements, offset)),
NodeAssign);
if (debug() >= 9) newp->dumpTree(cout, "-new ");
newlistp = AstNode::addNextNull(newlistp, newp);
newlistp = AstNode::addNext(newlistp, newp);
}
if (debug() >= 9) nodep->dumpTree(cout, " Deslice-Dn: ");
nodep->replaceWith(newlistp);