Skip to content

Commit

Permalink
Make matchOrAndNot non-static and use pushDeletep inside
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Oct 16, 2023
1 parent fe7ef9f commit afb3c6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/V3Const.cpp
Original file line number Diff line number Diff line change
@@ -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()) {

0 comments on commit afb3c6b

Please sign in to comment.