From b7ad1e6d61b648d4afdd3fbdaae2d98ed1e10691 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 2 Jan 2022 10:32:35 -0500 Subject: [PATCH] Internals: Rename some non-nodes to avoid Ast prefix. No functional change. --- src/V3Ast.cpp | 50 ++++++++++++++++++++++---------------------- src/V3Ast.h | 34 +++++++++++++++--------------- src/V3Cast.cpp | 4 ++-- src/V3Clean.cpp | 2 +- src/V3Const.cpp | 2 +- src/V3Depth.cpp | 2 +- src/V3DepthBlock.cpp | 2 +- src/V3Expand.cpp | 2 +- src/V3LinkJump.cpp | 2 +- src/V3Order.cpp | 2 +- src/V3Premit.cpp | 6 +++--- src/V3Split.cpp | 2 +- src/V3Tristate.cpp | 2 +- src/V3Unknown.cpp | 10 ++++----- src/V3Width.cpp | 22 +++++++++---------- src/astgen | 2 -- 16 files changed, 72 insertions(+), 74 deletions(-) diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 77211d427..341199d14 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -441,12 +441,12 @@ void AstNode::addOp4p(AstNode* newp) { void AstNode::replaceWith(AstNode* newp) { // Replace oldp with this // Unlike a unlink/relink, children are changed to point to the new node. - AstNRelinker repHandle; + VNRelinker repHandle; this->unlinkFrBack(&repHandle); repHandle.relink(newp); } -void AstNRelinker::dump(std::ostream& str) const { +void VNRelinker::dump(std::ostream& str) const { str << " BK=" << reinterpret_cast(m_backp); str << " ITER=" << reinterpret_cast(m_iterpp); str << " CHG=" << (m_chg == RELINK_NEXT ? "[NEXT] " : ""); @@ -456,7 +456,7 @@ void AstNRelinker::dump(std::ostream& str) const { str << (m_chg == RELINK_OP4 ? "[OP4] " : ""); } -AstNode* AstNode::unlinkFrBackWithNext(AstNRelinker* linkerp) { +AstNode* AstNode::unlinkFrBackWithNext(VNRelinker* linkerp) { debugTreeChange(this, "-unlinkWNextThs: ", __LINE__, true); AstNode* const oldp = this; UASSERT(oldp->m_backp, "Node has no back, already unlinked?"); @@ -467,15 +467,15 @@ AstNode* AstNode::unlinkFrBackWithNext(AstNRelinker* linkerp) { linkerp->m_backp = backp; linkerp->m_iterpp = oldp->m_iterpp; if (backp->m_nextp == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_NEXT; + linkerp->m_chg = VNRelinker::RELINK_NEXT; } else if (backp->m_op1p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP1; + linkerp->m_chg = VNRelinker::RELINK_OP1; } else if (backp->m_op2p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP2; + linkerp->m_chg = VNRelinker::RELINK_OP2; } else if (backp->m_op3p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP3; + linkerp->m_chg = VNRelinker::RELINK_OP3; } else if (backp->m_op4p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP4; + linkerp->m_chg = VNRelinker::RELINK_OP4; } else { oldp->v3fatalSrc("Unlink of node with back not pointing to it."); } @@ -516,7 +516,7 @@ AstNode* AstNode::unlinkFrBackWithNext(AstNRelinker* linkerp) { return oldp; } -AstNode* AstNode::unlinkFrBack(AstNRelinker* linkerp) { +AstNode* AstNode::unlinkFrBack(VNRelinker* linkerp) { debugTreeChange(this, "-unlinkFrBkThs: ", __LINE__, true); AstNode* const oldp = this; UASSERT(oldp->m_backp, "Node has no back, already unlinked?"); @@ -527,15 +527,15 @@ AstNode* AstNode::unlinkFrBack(AstNRelinker* linkerp) { linkerp->m_backp = backp; linkerp->m_iterpp = oldp->m_iterpp; if (backp->m_nextp == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_NEXT; + linkerp->m_chg = VNRelinker::RELINK_NEXT; } else if (backp->m_op1p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP1; + linkerp->m_chg = VNRelinker::RELINK_OP1; } else if (backp->m_op2p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP2; + linkerp->m_chg = VNRelinker::RELINK_OP2; } else if (backp->m_op3p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP3; + linkerp->m_chg = VNRelinker::RELINK_OP3; } else if (backp->m_op4p == oldp) { - linkerp->m_chg = AstNRelinker::RELINK_OP4; + linkerp->m_chg = VNRelinker::RELINK_OP4; } else { this->v3fatalSrc("Unlink of node with back not pointing to it."); } @@ -580,7 +580,7 @@ AstNode* AstNode::unlinkFrBack(AstNRelinker* linkerp) { return oldp; } -void AstNode::relink(AstNRelinker* linkerp) { +void AstNode::relink(VNRelinker* linkerp) { if (debug() > 8) { UINFO(0, " EDIT: relink: "); dumpPtrs(); @@ -600,11 +600,11 @@ void AstNode::relink(AstNRelinker* linkerp) { debugTreeChange(backp, "-relinkTre: ", __LINE__, true); switch (linkerp->m_chg) { - case AstNRelinker::RELINK_NEXT: backp->addNextHere(newp); break; - case AstNRelinker::RELINK_OP1: relinkOneLink(backp->m_op1p /*ref*/, newp); break; - case AstNRelinker::RELINK_OP2: relinkOneLink(backp->m_op2p /*ref*/, newp); break; - case AstNRelinker::RELINK_OP3: relinkOneLink(backp->m_op3p /*ref*/, newp); break; - case AstNRelinker::RELINK_OP4: relinkOneLink(backp->m_op4p /*ref*/, newp); break; + case VNRelinker::RELINK_NEXT: backp->addNextHere(newp); break; + case VNRelinker::RELINK_OP1: relinkOneLink(backp->m_op1p /*ref*/, newp); break; + case VNRelinker::RELINK_OP2: relinkOneLink(backp->m_op2p /*ref*/, newp); break; + case VNRelinker::RELINK_OP3: relinkOneLink(backp->m_op3p /*ref*/, newp); break; + case VNRelinker::RELINK_OP4: relinkOneLink(backp->m_op4p /*ref*/, newp); break; default: this->v3fatalSrc("Relink of node without any link to change."); break; } // Relink @@ -654,15 +654,15 @@ void AstNode::relinkOneLink(AstNode*& pointpr, // Ref to pointer that gets set void AstNode::addHereThisAsNext(AstNode* newp) { // {old}->this->{next} becomes {old}->new->this->{next} - AstNRelinker handle; + VNRelinker handle; this->unlinkFrBackWithNext(&handle); newp->addNext(this); handle.relink(newp); } void AstNode::swapWith(AstNode* bp) { - AstNRelinker aHandle; - AstNRelinker bHandle; + VNRelinker aHandle; + VNRelinker bHandle; this->unlinkFrBack(&aHandle); bp->unlinkFrBack(&bHandle); aHandle.relink(bp); @@ -1279,9 +1279,9 @@ AstNodeDType* AstNode::findVoidDType() const { } //###################################################################### -// AstNDeleter +// VNDeleter -void AstNDeleter::doDeletes() { +void VNDeleter::doDeletes() { for (AstNode* const nodep : m_deleteps) nodep->deleteTree(); m_deleteps.clear(); } diff --git a/src/V3Ast.h b/src/V3Ast.h index 11097f8b7..e943b30a9 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -1157,7 +1157,7 @@ public: // user2. When the member goes out of scope it will be automagically // freed up. -class AstUserInUseBase VL_NOT_FINAL { +class VNUserInUseBase VL_NOT_FINAL { protected: static void allocate(int id, uint32_t& cntGblRef, bool& userBusyRef) { // Perhaps there's still a AstUserInUse in scope for this? @@ -1188,7 +1188,7 @@ protected: // We let AstNode peek into here, because when under low optimization even // an accessor would be way too slow. // clang-format off -class AstUser1InUse final : AstUserInUseBase { +class AstUser1InUse final : VNUserInUseBase { protected: friend class AstNode; static uint32_t s_userCntGbl; // Count of which usage of userp() this is @@ -1199,7 +1199,7 @@ public: static void clear() { clearcnt(1, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } static void check() { checkcnt(1, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } }; -class AstUser2InUse final : AstUserInUseBase { +class AstUser2InUse final : VNUserInUseBase { protected: friend class AstNode; static uint32_t s_userCntGbl; // Count of which usage of userp() this is @@ -1210,7 +1210,7 @@ public: static void clear() { clearcnt(2, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } static void check() { checkcnt(2, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } }; -class AstUser3InUse final : AstUserInUseBase { +class AstUser3InUse final : VNUserInUseBase { protected: friend class AstNode; static uint32_t s_userCntGbl; // Count of which usage of userp() this is @@ -1221,7 +1221,7 @@ public: static void clear() { clearcnt(3, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } static void check() { checkcnt(3, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } }; -class AstUser4InUse final : AstUserInUseBase { +class AstUser4InUse final : VNUserInUseBase { protected: friend class AstNode; static uint32_t s_userCntGbl; // Count of which usage of userp() this is @@ -1232,7 +1232,7 @@ public: static void clear() { clearcnt(4, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } static void check() { checkcnt(4, s_userCntGbl/*ref*/, s_userBusy/*ref*/); } }; -class AstUser5InUse final : AstUserInUseBase { +class AstUser5InUse final : VNUserInUseBase { protected: friend class AstNode; static uint32_t s_userCntGbl; // Count of which usage of userp() this is @@ -1251,7 +1251,7 @@ public: // nodes needs to be deferred to a later time, because pointers to the // removed nodes might still exist. -class AstNDeleter VL_NOT_FINAL { +class VNDeleter VL_NOT_FINAL { // MEMBERS std::vector m_deleteps; // Nodes to delete @@ -1268,14 +1268,14 @@ public: void doDeletes(); // Do the deletions on destruction - virtual ~AstNDeleter() { doDeletes(); } + virtual ~VNDeleter() { doDeletes(); } }; //###################################################################### // AstNVisitor -- Allows new functions to be called on each node // type without changing the base classes. See "Modern C++ Design". -class AstNVisitor VL_NOT_FINAL : public AstNDeleter { +class AstNVisitor VL_NOT_FINAL : public VNDeleter { friend class AstNode; public: @@ -1303,10 +1303,10 @@ public: }; //###################################################################### -// AstNRelinker -- Holds the state of a unlink so a new node can be +// VNRelinker -- Holds the state of a unlink so a new node can be // added at the same point. -class AstNRelinker final { +class VNRelinker final { protected: friend class AstNode; enum RelinkWhatEn : uint8_t { @@ -1323,12 +1323,12 @@ protected: AstNode** m_iterpp = nullptr; public: - AstNRelinker() = default; + VNRelinker() = default; void relink(AstNode* newp); AstNode* oldp() const { return m_oldp; } void dump(std::ostream& str = std::cout) const; }; -inline std::ostream& operator<<(std::ostream& os, const AstNRelinker& rhs) { +inline std::ostream& operator<<(std::ostream& os, const VNRelinker& rhs) { rhs.dump(os); return os; } @@ -1771,12 +1771,12 @@ public: } void addHereThisAsNext(AstNode* newp); // Adds at old place of this, this becomes next void replaceWith(AstNode* newp); // Replace current node in tree with new node - AstNode* unlinkFrBack(AstNRelinker* linkerp + AstNode* unlinkFrBack(VNRelinker* linkerp = nullptr); // Unlink this from whoever points to it. // Unlink this from whoever points to it, keep entire next list with unlinked node - AstNode* unlinkFrBackWithNext(AstNRelinker* linkerp = nullptr); + AstNode* unlinkFrBackWithNext(VNRelinker* linkerp = nullptr); void swapWith(AstNode* bp); - void relink(AstNRelinker* linkerp); // Generally use linker->relink() instead + void relink(VNRelinker* linkerp); // Generally use linker->relink() instead void cloneRelinkNode() { cloneRelink(); } // Iterate and insert - assumes tree format virtual void addNextStmt(AstNode* newp, @@ -1935,7 +1935,7 @@ inline std::ostream& operator<<(std::ostream& os, const AstNode* rhs) { } return os; } -inline void AstNRelinker::relink(AstNode* newp) { newp->AstNode::relink(this); } +inline void VNRelinker::relink(AstNode* newp) { newp->AstNode::relink(this); } //###################################################################### //###################################################################### diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp index cc73faf47..e6fc24917 100644 --- a/src/V3Cast.cpp +++ b/src/V3Cast.cpp @@ -63,7 +63,7 @@ private: void insertCast(AstNode* nodep, int needsize) { // We'll insert ABOVE passed node UINFO(4, " NeedCast " << nodep << endl); - AstNRelinker relinkHandle; + VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); // AstCCast* const castp @@ -102,7 +102,7 @@ private: void ensureNullChecked(AstNode* nodep) { // TODO optimize to track null checked values and avoid where possible if (!VN_IS(nodep->backp(), NullCheck)) { - AstNRelinker relinkHandle; + VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); AstNode* const newp = new AstNullCheck{nodep->fileline(), nodep}; relinkHandle.relink(newp); diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 1bc6dd8f5..8e789f41a 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -120,7 +120,7 @@ private: // Operate on nodes void insertClean(AstNode* nodep) { // We'll insert ABOVE passed node UINFO(4, " NeedClean " << nodep << endl); - AstNRelinker relinkHandle; + VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); // computeCppWidth(nodep); diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 6a752c55f..a217f85a8 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -1809,7 +1809,7 @@ private: } void replaceShiftOp(AstNodeBiop* nodep) { UINFO(5, "SHIFT(AND(a,b),CONST)->AND(SHIFT(a,CONST),SHIFT(b,CONST)) " << nodep << endl); - AstNRelinker handle; + VNRelinker handle; nodep->unlinkFrBack(&handle); AstNodeBiop* const lhsp = VN_AS(nodep->lhsp(), NodeBiop); lhsp->unlinkFrBack(); diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp index 59a8e5eac..c2439874c 100644 --- a/src/V3Depth.cpp +++ b/src/V3Depth.cpp @@ -62,7 +62,7 @@ private: // Put assignment before the referencing statement AstAssign* const assp = new AstAssign{ nodep->fileline(), new AstVarRef{nodep->fileline(), varp, VAccess::WRITE}, nodep}; - AstNRelinker linker2; + VNRelinker linker2; m_stmtp->unlinkFrBack(&linker2); assp->addNext(m_stmtp); linker2.relink(assp); diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index fa53370cf..22f0bcd06 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -46,7 +46,7 @@ private: VL_DEBUG_FUNC; // Declare debug() AstCFunc* createDeepFunc(AstNode* nodep) { - AstNRelinker relinkHandle; + VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); // Create sub function AstScope* const scopep = m_cfuncp->scopep(); diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index 705a6f3f9..da901c90e 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -82,7 +82,7 @@ private: static void insertBefore(AstNode* placep, AstNode* newp) { newp->user1(1); // Already processed, don't need to re-iterate - AstNRelinker linker; + VNRelinker linker; placep->unlinkFrBack(&linker); newp->addNext(placep); linker.relink(newp); diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp index c590847a8..6ff11cbc9 100644 --- a/src/V3LinkJump.cpp +++ b/src/V3LinkJump.cpp @@ -100,7 +100,7 @@ private: AstJumpLabel* const labelp = new AstJumpLabel(nodep->fileline(), blockp); blockp->labelp(labelp); - AstNRelinker repHandle; + VNRelinker repHandle; if (under_and_next) { underp->unlinkFrBackWithNext(&repHandle); } else { diff --git a/src/V3Order.cpp b/src/V3Order.cpp index f58c1636d..3ec715f06 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -1034,7 +1034,7 @@ public: //###################################################################### // OrderProcess class -class OrderProcess final : AstNDeleter { +class OrderProcess final : VNDeleter { // NODE STATE // AstNodeModule::user3 -> int: Number of AstCFuncs created under this module // AstNode::user4 -> Used by V3Const::constifyExpensiveEdit diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 7c151df6f..39a8650cb 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -155,7 +155,7 @@ private: } else if (m_inTracep) { m_inTracep->addPrecondsp(newp); } else if (m_stmtp) { - AstNRelinker linker; + VNRelinker linker; m_stmtp->unlinkFrBack(&linker); newp->addNext(m_stmtp); linker.relink(newp); @@ -167,7 +167,7 @@ private: void createDeepTemp(AstNode* nodep, bool noSubst) { if (nodep->user1SetOnce()) return; // Only add another assignment for this node - AstNRelinker relinker; + VNRelinker relinker; nodep->unlinkFrBack(&relinker); FileLine* const fl = nodep->fileline(); @@ -276,7 +276,7 @@ private: // C operator's width must be < maximum shift which is // based on Verilog width && nodep->width() < (1LL << nodep->rhsp()->widthMin())) { - AstNRelinker replaceHandle; + VNRelinker replaceHandle; nodep->unlinkFrBack(&replaceHandle); AstNode* constzerop; const int m1value diff --git a/src/V3Split.cpp b/src/V3Split.cpp index ea7c357cf..6b8241c65 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -543,7 +543,7 @@ protected: if (leaveAlone) { UINFO(6, " No changes\n"); } else { - AstNRelinker replaceHandle; // Where to add the list + VNRelinker replaceHandle; // Where to add the list AstNode* newListp = nullptr; for (auto it = rankMap.cbegin(); it != rankMap.cend(); ++it) { AstNode* const nextp = it->second; diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index 49e19534e..a6d66421b 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -1010,7 +1010,7 @@ class TristateVisitor final : public TristateBaseVisitor { AstVar* const envarp = getCreateEnVarp(varrefp->varp()); // If any drops, we need to add in the count of Zs (from __en) UINFO(4, " COUNTBITS('z)-> " << nodep << endl); - AstNRelinker relinkHandle; + VNRelinker relinkHandle; nodep->unlinkFrBack(&relinkHandle); AstNode* newp = new AstCountOnes( nodep->fileline(), new AstVarRef(nodep->fileline(), envarp, VAccess::READ)); diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index 18bf8b066..b5daaf8a5 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -110,7 +110,7 @@ private: // Saves us teaching V3Const how to optimize, and it won't be needed again. if (const AstIf* const ifp = VN_AS(prep->user2p(), If)) { UASSERT_OBJ(!needDly, prep, "Should have already converted to non-delay"); - AstNRelinker replaceHandle; + VNRelinker replaceHandle; AstNode* const earliercondp = ifp->condp()->unlinkFrBack(&replaceHandle); AstNode* const newp = new AstLogAnd(condp->fileline(), condp, earliercondp); UINFO(4, "Edit BOUNDLVALUE " << newp << endl); @@ -330,7 +330,7 @@ private: = new AstVar(nodep->fileline(), AstVarType::XTEMP, m_xrandNames.get(nodep), VFlagLogicPacked(), nodep->width()); ++m_statUnkVars; - AstNRelinker replaceHandle; + VNRelinker replaceHandle; nodep->unlinkFrBack(&replaceHandle); AstNodeVarRef* const newref1p = new AstVarRef(nodep->fileline(), newvarp, VAccess::READ); @@ -386,7 +386,7 @@ private: VL_DO_DANGLING(condp->deleteTree(), condp); } else if (!lvalue) { // SEL(...) -> COND(LTE(bit<=maxmsb), ARRAYSEL(...), {width{1'bx}}) - AstNRelinker replaceHandle; + VNRelinker replaceHandle; nodep->unlinkFrBack(&replaceHandle); V3Number xnum(nodep, nodep->width()); xnum.setAllBitsX(); @@ -445,7 +445,7 @@ private: // Making a scalar would break if we're making an array && !VN_IS(nodep->dtypep()->skipRefp(), NodeArrayDType)) { // ARRAYSEL(...) -> COND(LT(bitunlinkFrBack(&replaceHandle); V3Number xnum(nodep, nodep->width()); if (nodep->isString()) { @@ -462,7 +462,7 @@ private: iterate(newp); } else if (!lvalue) { // Mid-multidimension read, just use zero // ARRAYSEL(...) -> ARRAYSEL(COND(LT(bitbitp()->unlinkFrBack(&replaceHandle); AstNode* const newp = new AstCondBound( bitp->fileline(), condp, bitp, diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 29396ed1c..7c1e9c5b8 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -3351,7 +3351,7 @@ private: if (patp->lhssp()->nextp()) { // Can't just addNext, as would add to end of all members. // So detach, add next and reattach - AstNRelinker relinkHandle; + VNRelinker relinkHandle; patp->unlinkFrBack(&relinkHandle); while (AstNode* const movep = patp->lhssp()->nextp()) { movep->unlinkFrBack(); // Not unlinkFrBackWithNext, just one @@ -4078,7 +4078,7 @@ private: || VN_IS(dtypep, QueueDType)) { added = true; newFormat += "%@"; - AstNRelinker handle; + VNRelinker handle; argp->unlinkFrBack(&handle); AstCMath* const newp = new AstCMath(nodep->fileline(), "VL_TO_STRING(", 0, true); @@ -4657,7 +4657,7 @@ private: if (portp->attrSFormat() && (!VN_IS(pinp, SFormatF) || pinp->nextp())) { // Not already done UINFO(4, " sformat via metacomment: " << nodep << endl); - AstNRelinker handle; + VNRelinker handle; argp->unlinkFrBackWithNext(&handle); // Format + additional args, if any AstNode* argsp = nullptr; while (AstArg* const nextargp = VN_AS(argp->nextp(), Arg)) { @@ -4691,7 +4691,7 @@ private: && VN_AS(pinp, VarRef)->varp()->basicp()->keyword() == AstBasicDTypeKwd::STRING)) { UINFO(4, " Add CvtPackString: " << pinp << endl); - AstNRelinker handle; + VNRelinker handle; pinp->unlinkFrBack(&handle); // No next, that's the next pin AstNode* const newp = new AstCvtPackString(pinp->fileline(), pinp); handle.relink(newp); @@ -5314,7 +5314,7 @@ private: nodep = newp; } else if (expWidth < nodep->width()) { // Trunc - Extract - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); AstNode* const newp = new AstSel(nodep->fileline(), nodep, 0, expWidth); newp->didWidth(true); // Don't replace dtype with unsigned @@ -5322,7 +5322,7 @@ private: nodep = newp; } else { // Extend - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); bool doSigned = false; switch (extendRule) { @@ -5367,7 +5367,7 @@ private: VL_DANGLING(nodep); nodep = newp; } else { - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); AstNode* const newp = new AstRedOr(nodep->fileline(), nodep); linker.relink(newp); @@ -5521,7 +5521,7 @@ private: // For DOUBLE under a logical op, add implied test against zero, never a warning if (underp && underp->isDouble()) { UINFO(6, " spliceCvtCmpD0: " << underp << endl); - AstNRelinker linker; + VNRelinker linker; underp->unlinkFrBack(&linker); AstNode* const newp = new AstNeqD(nodep->fileline(), underp, @@ -5727,7 +5727,7 @@ private: // We don't warn here, "2.0 * 2" is common and reasonable if (nodep && !nodep->dtypep()->skipRefp()->isDouble()) { UINFO(6, " spliceCvtD: " << nodep << endl); - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); AstNode* newp; if (nodep->dtypep()->skipRefp()->isSigned()) { @@ -5746,7 +5746,7 @@ private: // 11.8.2: Argument to convert is self-determined if (nodep && nodep->dtypep()->skipRefp()->isDouble()) { UINFO(6, " spliceCvtS: " << nodep << endl); - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); if (const AstConst* const constp = VN_CAST(nodep, Const)) { // We convert to/from vlsint32 rather than use floor() as want to make sure is @@ -5772,7 +5772,7 @@ private: // 11.8.2: Argument to convert is self-determined if (nodep && !(nodep->dtypep()->basicp() && nodep->dtypep()->basicp()->isString())) { UINFO(6, " spliceCvtString: " << nodep << endl); - AstNRelinker linker; + VNRelinker linker; nodep->unlinkFrBack(&linker); AstNode* const newp = new AstCvtPackString(nodep->fileline(), nodep); linker.relink(newp); diff --git a/src/astgen b/src/astgen index d9e6c8eda..bb444be70 100755 --- a/src/astgen +++ b/src/astgen @@ -366,8 +366,6 @@ def read_types(filename): supern = match.group(1) if match else "" assert classn != "AstNode" or supern == "", "AstNode can't have a superclass" if re.search(r'Ast', supern) or classn == "AstNode": - if supern == "AstNDeleter": - continue classn = re.sub(r'^Ast', '', classn) supern = re.sub(r'^Ast', '', supern) Classes[classn] = supern