Internals: Remove redundant AstNode::addNextStmt

This commit is contained in:
Geza Lore
2025-10-21 12:41:50 +01:00
parent cf275b6e58
commit 8daae7336d
4 changed files with 3 additions and 21 deletions
+3 -2
View File
@@ -114,7 +114,8 @@ class UnknownVisitor final : public VNVisitor {
AstVar* const varp
= new AstVar{fl, VVarType::MODULETEMP, m_lvboundNames.get(prep), prep->dtypep()};
m_modp->addStmtsp(varp);
AstNode* const abovep = prep->backp(); // Grab above point before we replace 'prep'
AstNode* stmtp = prep->backp(); // Grab above point before we replace 'prep'
while (!VN_IS(stmtp, NodeStmt)) stmtp = stmtp->backp();
prep->replaceWith(new AstVarRef{fl, varp, VAccess::WRITE});
if (m_timingControlp) m_timingControlp->unlinkFrBack();
@@ -128,7 +129,7 @@ class UnknownVisitor final : public VNVisitor {
newp->branchPred(VBranchPred::BP_LIKELY);
newp->isBoundsCheck(true);
UINFOTREE(9, newp, "", "_new");
abovep->addNextStmt(newp, abovep);
stmtp->addNextHere(newp);
prep->user2p(newp); // Save so we may LogAnd it next time
}
}