From afb3c6bf2da8ba06632e50d8e24f9cb8f442156f Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Mon, 16 Oct 2023 13:13:25 +0200 Subject: [PATCH] Make matchOrAndNot non-static and use pushDeletep inside Signed-off-by: Ryszard Rozak --- src/V3Const.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 1435d3ab0d..eb56d922d6 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -1012,7 +1012,7 @@ class ConstVisitor final : public VNVisitor { return (lp && rp && lp->width() == rp->width() && lp->type() == rp->type() && (operandsSame(lp->lhsp(), rp->lhsp()) || operandsSame(lp->rhsp(), rp->rhsp()))); } - static bool matchOrAndNot(AstNodeBiop* nodep) { + bool matchOrAndNot(AstNodeBiop* nodep) { // AstOr{$a, AstAnd{AstNot{$b}, $c}} if $a.width1, $a==$b => AstOr{$a,$c} // Someday we'll sort the biops completely and this can be simplified // This often results from our simplified clock generation: @@ -1043,7 +1043,7 @@ class ConstVisitor final : public VNVisitor { if (!operandsSame(ap, bp)) return false; // Do it cp->unlinkFrBack(); - VL_DO_DANGLING(andp->unlinkFrBack()->deleteTree(), andp); + VL_DO_DANGLING(pushDeletep(andp->unlinkFrBack()), andp); VL_DANGLING(notp); // Replace whichever branch is now dangling if (nodep->rhsp()) {