Internals: Remove redundant AstNode::addNextStmt
This commit is contained in:
parent
cf275b6e58
commit
8daae7336d
|
|
@ -825,9 +825,6 @@ public:
|
|||
void swapWith(AstNode* bp);
|
||||
void relink(VNRelinker* linkerp); // Generally use linker->relink() instead
|
||||
void cloneRelinkNode() { cloneRelink(); }
|
||||
// Iterate and insert - assumes tree format
|
||||
virtual void addNextStmt(AstNode* newp,
|
||||
AstNode* belowp); // When calling, "this" is second argument
|
||||
|
||||
// METHODS - Iterate on a tree
|
||||
AstNode* cloneTree(bool cloneNextLink,
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ protected:
|
|||
public:
|
||||
ASTGEN_MEMBERS_AstNodeStmt;
|
||||
// METHODS
|
||||
void addNextStmt(AstNode* newp,
|
||||
AstNode* belowp) override; // Stop statement searchback here
|
||||
void dump(std::ostream& str = std::cout) const override;
|
||||
void dumpJson(std::ostream& str = std::cout) const override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1528,20 +1528,6 @@ AstVarScope* AstConstPool::findConst(AstConst* initp, bool mergeDType) {
|
|||
return varScopep;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Special walking tree inserters
|
||||
|
||||
void AstNode::addNextStmt(AstNode* newp, AstNode*) {
|
||||
UASSERT_OBJ(backp(), newp, "Can't find current statement to addNextStmt");
|
||||
// Look up; virtual call will find where to put it
|
||||
this->backp()->addNextStmt(newp, this);
|
||||
}
|
||||
|
||||
void AstNodeStmt::addNextStmt(AstNode* newp, AstNode*) {
|
||||
// Insert newp after current node
|
||||
this->addNextHere(newp);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Per-type Debugging
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue