mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Internals: Move iterators to AstNVisitor to avoid null this.
This commit is contained in:
+4
-4
@@ -618,11 +618,11 @@ sub tree_base {
|
||||
if ($out_for_type_sc[0]) { # Short-circuited types
|
||||
$self->print(" // Generated by astgen with short-circuiting\n",
|
||||
" virtual void visit(Ast${type}* nodep) {\n",
|
||||
" nodep->lhsp()->iterateAndNext(*this);\n",
|
||||
" iterateAndNextNull(nodep->lhsp());\n",
|
||||
@out_for_type_sc);
|
||||
$self->print(" nodep->rhsp()->iterateAndNext(*this);\n",
|
||||
$self->print(" iterateAndNextNull(nodep->rhsp());\n",
|
||||
" AstNodeTriop *tnp = VN_CAST(nodep, NodeTriop);\n",
|
||||
" if (tnp && tnp->thsp()) tnp->thsp()->iterateAndNext(*this);\n",
|
||||
" if (tnp && tnp->thsp()) iterateAndNextNull(tnp->thsp());\n",
|
||||
@out_for_type,
|
||||
" }\n") if ($out_for_type[0]);
|
||||
} elsif ($out_for_type[0]) { # Other types with something to print
|
||||
@@ -631,7 +631,7 @@ sub tree_base {
|
||||
$self->print(" // Generated by astgen\n",
|
||||
" virtual void visit$gen(Ast${type}* nodep) {\n",
|
||||
($skip?"":
|
||||
" nodep->iterateChildren(*this);\n"),
|
||||
" iterateChildren(nodep);\n"),
|
||||
@out_for_type,
|
||||
" }\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user