From 05e12ab60ea1c50d7dec96f5c8806cfce9406572 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 26 Nov 2021 10:02:04 -0500 Subject: [PATCH] Internals: More const. No functional change intended. --- src/V3Active.cpp | 2 +- src/V3ActiveTop.cpp | 2 +- src/V3Assert.cpp | 2 +- src/V3Begin.cpp | 2 +- src/V3Branch.cpp | 2 +- src/V3CUse.cpp | 2 +- src/V3Case.cpp | 2 +- src/V3Cast.cpp | 4 ++-- src/V3Cdc.cpp | 6 +++--- src/V3Changed.cpp | 2 +- src/V3Class.cpp | 2 +- src/V3Clean.cpp | 6 +++--- src/V3Clock.cpp | 2 +- src/V3Combine.cpp | 2 +- src/V3Common.cpp | 2 +- src/V3Const.cpp | 6 +++--- src/V3Coverage.cpp | 2 +- src/V3Dead.cpp | 2 +- src/V3Delayed.cpp | 12 ++++++------ src/V3Descope.cpp | 2 +- src/V3EmitCBase.h | 2 +- src/V3EmitCFunc.h | 2 +- src/V3EmitCImp.cpp | 2 +- src/V3EmitCSyms.cpp | 2 +- src/V3Expand.cpp | 2 +- src/V3Gate.cpp | 8 ++++---- src/V3GenClk.cpp | 8 ++++---- src/V3Global.cpp | 2 +- src/V3Hasher.h | 2 +- src/V3HierBlock.cpp | 2 +- src/V3Inline.cpp | 22 ++++++++++------------ src/V3Inst.cpp | 2 +- src/V3InstrCount.cpp | 2 +- src/V3Life.cpp | 2 +- src/V3LifePost.cpp | 2 +- src/V3LinkCells.cpp | 4 ++-- src/V3LinkDot.cpp | 10 +++++----- src/V3LinkParse.cpp | 4 ++-- src/V3LinkResolve.cpp | 2 +- src/V3Localize.cpp | 8 ++++---- src/V3MergeCond.cpp | 4 ++-- src/V3Name.cpp | 2 +- src/V3Order.cpp | 6 +++--- src/V3Param.cpp | 4 ++-- src/V3Partition.cpp | 2 +- src/V3Premit.cpp | 6 +++--- src/V3Randomize.cpp | 4 ++-- src/V3Reloop.cpp | 2 +- src/V3Scope.cpp | 4 ++-- src/V3Simulate.h | 6 +++--- src/V3Slice.cpp | 2 +- src/V3Split.cpp | 8 ++++---- src/V3SplitAs.cpp | 2 +- src/V3SplitVar.cpp | 2 +- src/V3Subst.cpp | 6 +++--- src/V3Task.cpp | 12 +++++------- src/V3Trace.cpp | 6 +++--- src/V3Tristate.cpp | 10 +++++----- src/V3Undriven.cpp | 4 ++-- src/V3Unknown.cpp | 4 ++-- src/V3VariableOrder.cpp | 2 +- src/V3WidthCommit.h | 2 +- 62 files changed, 125 insertions(+), 129 deletions(-) diff --git a/src/V3Active.cpp b/src/V3Active.cpp index e2e3ddd0e..a20bae1fc 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -299,7 +299,7 @@ private: // NODE STATE // Input: // AstVar::user1p // V2LatchGraphVertex* The vertex handling this node - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE LatchDetectGraph m_graph; // Graph used to detect latches in combo always // VISITORS diff --git a/src/V3ActiveTop.cpp b/src/V3ActiveTop.cpp index cf786c44a..ab5155cd4 100644 --- a/src/V3ActiveTop.cpp +++ b/src/V3ActiveTop.cpp @@ -42,7 +42,7 @@ private: // AstNode::user() bool. True if processed // Each call to V3Const::constify // AstNode::user4() Used by V3Const::constify, called below - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE SenTreeFinder m_finder; // Find global sentree's / add them under the AstTopScope diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index 72803b93e..20f8c3725 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -30,7 +30,7 @@ private: // NODE STATE/TYPES // Cleared on netlist // AstNode::user() -> bool. True if processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNodeModule* m_modp = nullptr; // Last module diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index d8797ce62..9d9d4a483 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -41,7 +41,7 @@ private: // NODE STATE // Entire netlist: // AstNodeFTask::user1 -> bool, 1=processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; bool m_anyFuncInBegin = false; public: diff --git a/src/V3Branch.cpp b/src/V3Branch.cpp index ae8a6f1d8..a3690bddc 100644 --- a/src/V3Branch.cpp +++ b/src/V3Branch.cpp @@ -40,7 +40,7 @@ private: // NODE STATE // Entire netlist: // AstFTask::user1() -> int. Number of references - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE int m_likely = false; // Excuses for branch likely taken diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index 5e35527df..2b4543bfe 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -39,7 +39,7 @@ class CUseVisitor final : public AstNVisitor { // NODE STATE // AstNode::user1() -> bool. True if already visited - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // MEMBERS bool m_impOnly = false; // In details needed only for implementation diff --git a/src/V3Case.cpp b/src/V3Case.cpp index 7e3502d99..830694d1a 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -122,7 +122,7 @@ private: // NODE STATE // Cleared each Case // AstIf::user3() -> bool. Set true to indicate clone not needed - AstUser3InUse m_inuser3; + const AstUser3InUse m_inuser3; // STATE VDouble0 m_statCaseFast; // Statistic tracking diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp index d8db3abe1..149202c70 100644 --- a/src/V3Cast.cpp +++ b/src/V3Cast.cpp @@ -54,7 +54,7 @@ private: // NODE STATE // Entire netlist: // AstNode::user() // bool. Indicates node is of known size - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE @@ -203,6 +203,6 @@ public: void V3Cast::castAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); - { CastVisitor visitor{nodep}; } // Destruct before checking + { const CastVisitor visitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("cast", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3); } diff --git a/src/V3Cdc.cpp b/src/V3Cdc.cpp index 2bd9da2cb..28851bcdb 100644 --- a/src/V3Cdc.cpp +++ b/src/V3Cdc.cpp @@ -217,9 +217,9 @@ private: // AstVarScope::user2 -> bool Used in sensitivity list // {statement}Node::user1p -> CdcLogicVertex* for this statement // AstNode::user3 -> bool True indicates to print %% (via V3EmitV) - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; // STATE V3Graph m_graph; // Scoreboard of var usages/dependencies diff --git a/src/V3Changed.cpp b/src/V3Changed.cpp index daef2b0f1..9d28c7ab2 100644 --- a/src/V3Changed.cpp +++ b/src/V3Changed.cpp @@ -247,7 +247,7 @@ private: // NODE STATE // Entire netlist: // AstVarScope::user1() -> bool. True indicates processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE ChangedState* m_statep; // Shared state across visitors diff --git a/src/V3Class.cpp b/src/V3Class.cpp index 7d1393f9e..5310b7862 100644 --- a/src/V3Class.cpp +++ b/src/V3Class.cpp @@ -32,7 +32,7 @@ class ClassVisitor final : public AstNVisitor { private: // MEMBERS - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; string m_prefix; // String prefix to add to name based on hier AstScope* m_classScopep = nullptr; // Package moving scopes into AstScope* m_packageScopep = nullptr; // Class package scope diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp index 4d0295a43..9eda5e56f 100644 --- a/src/V3Clean.cpp +++ b/src/V3Clean.cpp @@ -42,9 +42,9 @@ private: // AstNode::user() -> CleanState. For this node, 0==UNKNOWN // AstNode::user2() -> bool. True indicates widthMin has been propagated // AstNodeDType::user3() -> AstNodeDType*. Alternative node with C size - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; // TYPES enum CleanState : uint8_t { CS_UNKNOWN, CS_CLEAN, CS_DIRTY }; diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index c16316a3e..8dde574f9 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -73,7 +73,7 @@ private: // NODE STATE // Cleared each Module: // AstVarScope::user1p() -> AstVarScope*. Temporary signal that was created. - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNodeModule* m_modp = nullptr; // Current module diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index 5fbfd1f3a..aa38734e4 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -121,7 +121,7 @@ class CombineVisitor final : CombBaseVisitor { private: // NODE STATE // Entire netlist: - AstUser3InUse m_user3InUse; // Marks replaced AstCFuncs + const AstUser3InUse m_user3InUse; // Marks replaced AstCFuncs // AstUser4InUse part of V3Hasher in V3DupFinder // STATE diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 7dcf3f8b7..1bfb366f3 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -109,7 +109,7 @@ void V3Common::commonAll() { // NODE STATE // Entire netlist: // AstClass::user1() -> bool. True if class needs to_string dumper - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // Create ToString methods makeVlToString(classp); makeToString(classp); diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 470120f63..ab5f73d1d 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -110,7 +110,7 @@ class ConstBitOpTreeVisitor final : public AstNVisitor { // NODE STATE // AstVarRef::user4u -> Base index of m_varInfos that points VarInfo // AstVarScope::user4u -> Same as AstVarRef::user4 - AstUser4InUse m_inuser4; + const AstUser4InUse m_inuser4; // TYPES @@ -1975,7 +1975,7 @@ private: if (m_warn && !VN_IS(nodep, AssignDly)) { // Is same var on LHS and RHS? // Note only do this (need user4) when m_warn, which is // done as unique visitor - AstUser4InUse m_inuser4; + const AstUser4InUse m_inuser4; ConstVarMarkVisitor mark{nodep->lhsp()}; ConstVarFindVisitor find{nodep->rhsp()}; if (find.found()) need_temp = true; @@ -2669,7 +2669,7 @@ private: // SENGATE(SENITEM(x)) -> SENITEM(x), then let it collapse with the // other SENITEM(x). { - AstUser4InUse m_inuse4; + const AstUser4InUse m_inuse4; // Mark x in SENITEM(x) for (AstSenItem* senp = nodep->sensesp(); senp; senp = VN_AS(senp->nextp(), SenItem)) { diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index e32a395e5..766149504 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -73,7 +73,7 @@ private: // NODE STATE // Entire netlist: // AstIf::user1() -> bool. True indicates ifelse processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE CheckState m_state; // State save-restored on each new coverage scope/block diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index bbdcad753..7af22c0c4 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -76,7 +76,7 @@ private: // AstVar::user1() -> int. Count of number of references // AstVarScope::user1() -> int. Count of number of references // AstNodeDType::user1() -> int. Count of number of references - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // TYPES using AssignMap = std::multimap; diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index 4b7d444de..9d16c28c6 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -81,11 +81,11 @@ private: // Cleared each scope/active: // AstAssignDly::user3() -> AstVarScope*. __Vdlyvset__ created for this assign // AstAlwaysPost::user3() -> AstVarScope*. __Vdlyvset__ last referenced in IF - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; - AstUser5InUse m_inuser5; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; + const AstUser5InUse m_inuser5; // STATE AstActive* m_activep = nullptr; // Current activate @@ -512,6 +512,6 @@ public: void V3Delayed::delayedAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); - { DelayedVisitor visitor{nodep}; } // Destruct before checking + { const DelayedVisitor visitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("delayed", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3); } diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index 05633fec0..b875ac291 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -39,7 +39,7 @@ private: // NODE STATE // Cleared entire netlist // AstCFunc::user() // bool. Indicates processing completed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // TYPES using FuncMmap = std::multimap; diff --git a/src/V3EmitCBase.h b/src/V3EmitCBase.h index 5843c80bc..65a83f69c 100644 --- a/src/V3EmitCBase.h +++ b/src/V3EmitCBase.h @@ -34,7 +34,7 @@ class EmitCParentModule final { // NODE STATE // AstFunc::user4p() AstNodeModule* Parent module pointer // AstVar::user4p() AstNodeModule* Parent module pointer - AstUser4InUse user4InUse; + const AstUser4InUse user4InUse; public: EmitCParentModule(); diff --git a/src/V3EmitCFunc.h b/src/V3EmitCFunc.h index 55d3a8151..4d1c342a3 100644 --- a/src/V3EmitCFunc.h +++ b/src/V3EmitCFunc.h @@ -37,7 +37,7 @@ constexpr int EMITC_NUM_CONSTW = 8; class EmitCLazyDecls final : public AstNVisitor { // NODE STATE/TYPES // AstNode::user2() -> bool. Already emitted decl for symbols. - AstUser2InUse m_inuser2; + const AstUser2InUse m_inuser2; // MEMBERS std::unordered_set m_emittedManually; // Set of names already declared manually. diff --git a/src/V3EmitCImp.cpp b/src/V3EmitCImp.cpp index 73aff137d..749c74e39 100644 --- a/src/V3EmitCImp.cpp +++ b/src/V3EmitCImp.cpp @@ -556,7 +556,7 @@ class EmitCTrace final : EmitCFunc { // NODE STATE/TYPES // Cleared on netlist // AstNode::user1() -> int. Enum number - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // MEMBERS const bool m_slow; // Making slow file diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index 024972b4d..b2e0f2942 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -34,7 +34,7 @@ class EmitCSyms final : EmitCBaseVisitor { // NODE STATE // Cleared on Netlist // AstNodeModule::user1() -> bool. Set true __Vconfigure called - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // TYPES struct ScopeData { diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index 3afd020bd..8d7634dda 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -42,7 +42,7 @@ class ExpandVisitor final : public AstNVisitor { private: // NODE STATE // AstNode::user1() -> bool. Processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNode* m_stmtp = nullptr; // Current statement diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index ccd8d7126..33e60c1f5 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -308,8 +308,8 @@ private: // AstVarScope::user2 -> bool: Signal used in SenItem in *this* always statement // AstVar::user2 -> bool: Warned about SYNCASYNCNET // AstNodeVarRef::user2 -> bool: ConcatOffset visited - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // STATE V3Graph m_graph; // Scoreboard of var usages/dependencies @@ -907,9 +907,9 @@ private: // Set to nullptr if this assign's tree was later replaced // AstUser1InUse m_inuser1; (Allocated for use in GateVisitor) // AstUser2InUse m_inuser2; (Allocated for use in GateVisitor) - AstUser3InUse m_inuser3; + const AstUser3InUse m_inuser3; // AstUser4InUse m_inuser4; (Allocated for use in V3Hasher via V3DupFinder) - AstUser5InUse m_inuser5; + const AstUser5InUse m_inuser5; V3DupFinder m_dupFinder; // Duplicate finder for rhs of assigns std::unordered_set m_nodeDeleteds; // Any node in this hash was deleted diff --git a/src/V3GenClk.cpp b/src/V3GenClk.cpp index 4c136ba38..ad2f012cb 100644 --- a/src/V3GenClk.cpp +++ b/src/V3GenClk.cpp @@ -43,8 +43,8 @@ private: // Cleared on top scope // AstVarScope::user2() -> AstVarScope*. Signal replacing activation with // AstVarRef::user3() -> bool. Signal is replaced activation (already done) - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; // STATE AstActive* m_activep = nullptr; // Inside activate statement @@ -141,7 +141,7 @@ private: // NODE STATE // Cleared on top scope // AstVarScope::user() -> bool. Set when the var has been used as clock - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE bool m_tracingCall = false; // Iterating into a call to a cfunc @@ -231,6 +231,6 @@ public: void V3GenClk::genClkAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); - { GenClkReadVisitor visitor{nodep}; } // Destruct before checking + { const GenClkReadVisitor visitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("genclk", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3); } diff --git a/src/V3Global.cpp b/src/V3Global.cpp index f86106411..1e6f41a9b 100644 --- a/src/V3Global.cpp +++ b/src/V3Global.cpp @@ -46,7 +46,7 @@ void V3Global::checkTree() const { rootp()->checkTree(); } void V3Global::readFiles() { // NODE STATE // AstNode::user4p() // VSymEnt* Package and typedef symbol names - AstUser4InUse inuser4; + const AstUser4InUse inuser4; VInFilter filter(v3Global.opt.pipeFilter()); V3ParseSym parseSyms(v3Global.rootp()); // Symbol table must be common across all parsing diff --git a/src/V3Hasher.h b/src/V3Hasher.h index 6207515f1..6bdfdc6be 100644 --- a/src/V3Hasher.h +++ b/src/V3Hasher.h @@ -32,7 +32,7 @@ class V3Hasher final { // NODE STATE // AstNode::user4() -> V3Hash. Hash value of this node (hash of 0 is illegal) - AstUser4InUse m_inuser4; + const AstUser4InUse m_inuser4; public: // CONSTRUCTORS diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index 58103c813..7940e0270 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -239,7 +239,7 @@ string V3HierBlock::commandArgsFileName(bool forCMake) const { class HierBlockUsageCollectVisitor final : public AstNVisitor { // NODE STATE // AstNode::user1() -> bool. Processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE using ModuleSet = std::unordered_set; diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index 3c13d9e56..b071728cc 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -53,9 +53,9 @@ private: // AstNodeModule::user2() // CIL_*. Allowed to automatically inline module // AstNodeModule::user3() // int. Number of cells referencing this module // AstNodeModule::user4() // int. Statements in module - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; // For the user2 field: enum : uint8_t { @@ -493,11 +493,10 @@ private: // // is a direct connect to // AstVar::user3() // bool Don't alias the user2, keep it as signal // AstCell::user4 // AstCell* of the created clone - - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; - AstUser5InUse m_inuser5; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; + const AstUser5InUse m_inuser5; // STATE AstNodeModule* m_modp = nullptr; // Current module @@ -625,8 +624,7 @@ class InlineIntfRefVisitor final : public AstNVisitor { private: // NODE STATE // AstVar::user1p() // AstCell which this Var points to - - AstUser2InUse m_inuser2; + const AstUser2InUse m_inuser2; string m_scope; // Scope name @@ -710,8 +708,8 @@ public: void V3Inline::inlineAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); - AstUser1InUse m_inuser1; // output of InlineMarkVisitor, - // input to InlineVisitor. + const AstUser1InUse m_inuser1; // output of InlineMarkVisitor, + // input to InlineVisitor. // Scoped to clean up temp userN's { InlineMarkVisitor mvisitor{nodep}; } { InlineVisitor visitor{nodep}; } diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index e35a9b9e0..55754113c 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -39,7 +39,7 @@ private: // NODE STATE // Cleared each Cell: // AstPin::user1p() -> bool. True if created assignment already - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstCell* m_cellp = nullptr; // Current cell diff --git a/src/V3InstrCount.cpp b/src/V3InstrCount.cpp index 7b1a6ab0e..6d1984a7c 100644 --- a/src/V3InstrCount.cpp +++ b/src/V3InstrCount.cpp @@ -34,7 +34,7 @@ private: // NODE STATE // AstNode::user4() -> int. Path cost + 1, 0 means don't dump // AstNode::user5() -> bool. Processed if assertNoDups - AstUser4InUse m_inuser4; + const AstUser4InUse m_inuser4; // MEMBERS uint32_t m_instrCount = 0; // Running count of instructions diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 7096f6558..38433a58e 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -41,7 +41,7 @@ class LifeState final { // NODE STATE // See below - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE public: diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp index dbfbf8de0..9dded9c9d 100644 --- a/src/V3LifePost.cpp +++ b/src/V3LifePost.cpp @@ -133,7 +133,7 @@ private: // NODE STATE // Cleared on entire tree // AstVarScope::user4() -> AstVarScope*: Passed to LifePostElim to substitute this var - AstUser4InUse m_inuser4; + const AstUser4InUse m_inuser4; // STATE uint32_t m_sequence = 0; // Sequence number of assigns/varrefs, diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp index ee631f419..d29440ed3 100644 --- a/src/V3LinkCells.cpp +++ b/src/V3LinkCells.cpp @@ -101,8 +101,8 @@ private: // AstCell::user2() // bool clone renaming completed // Allocated across all readFiles in V3Global::readFiles: // AstNode::user4p() // VSymEnt* Package and typedef symbol names - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // STATE VInFilter* m_filterp; // Parser filter diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 402638d82..31e2b9815 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -129,9 +129,9 @@ private: // AstVar::user4() // bool. True if port set for this variable // AstNodeBlock::user4() // bool. Did name processing // AstNodeModule::user4() // bool. Live module - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser4InUse m_inuser4; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser4InUse m_inuser4; public: // ENUMS @@ -1783,8 +1783,8 @@ private: // *::user4() -> See LinkDotState // Cleared on Cell // AstVar::user5() // bool. True if pin used in this cell - AstUser3InUse m_inuser3; - AstUser5InUse m_inuser5; + const AstUser3InUse m_inuser3; + const AstUser5InUse m_inuser5; // TYPES enum DotPosition : uint8_t { diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index c9b0e0113..305150cb7 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -40,8 +40,8 @@ private: // Cleared on netlist // AstNode::user1() -> bool. True if processed // AstNode::user2() -> bool. True if fileline recomputed - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // TYPES using ImplTypedefMap = std::map, AstTypedef*>; diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index d88a03c51..d013ab90e 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -43,7 +43,7 @@ private: // NODE STATE // Entire netlist: // AstCaseItem::user2() // bool Moved default caseitems - AstUser2InUse m_inuser2; + const AstUser2InUse m_inuser2; // STATE // Below state needs to be preserved between each module call. diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index e9c048f28..c8f8289d6 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -45,10 +45,10 @@ private: // AstVarScope::user3p() -> Set of CFuncs referencing this VarScope. (via m_accessors) // AstCFunc::user4p() -> Multimap of 'VarScope -> VarRefs that reference that VarScope' // in this function. (via m_references) - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; AstUser3Allocator> m_accessors; AstUser4Allocator> diff --git a/src/V3MergeCond.cpp b/src/V3MergeCond.cpp index f8bbf8bcb..1c01230e9 100644 --- a/src/V3MergeCond.cpp +++ b/src/V3MergeCond.cpp @@ -131,8 +131,8 @@ private: // NODE STATE // AstVar::user1 -> Flag set for variables referenced by m_mgCondp // AstNode::user2 -> Flag marking node as included in merge because cheap to duplicate - AstUser1InUse m_user1InUse; - AstUser2InUse m_user2InUse; + const AstUser1InUse m_user1InUse; + const AstUser2InUse m_user2InUse; // STATE VDouble0 m_statMerges; // Statistic tracking diff --git a/src/V3Name.cpp b/src/V3Name.cpp index 0583dc90c..7d1537792 100644 --- a/src/V3Name.cpp +++ b/src/V3Name.cpp @@ -37,7 +37,7 @@ private: // AstCell::user1() -> bool. Set true if already processed // AstScope::user1() -> bool. Set true if already processed // AstVar::user1() -> bool. Set true if already processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNodeModule* m_modp = nullptr; diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 05b7b52d6..42c6765cb 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -364,8 +364,8 @@ class OrderBuildVisitor final : public AstNVisitor { // NODE STATE // AstVarScope::user1 -> OrderUser instance for variable (via m_orderUser) // AstVarScope::user2 -> VarUsage within logic blocks - AstUser1InUse user1InUse; - AstUser2InUse user2InUse; + const AstUser1InUse user1InUse; + const AstUser2InUse user2InUse; AstUser1Allocator m_orderUser; // STATE @@ -1038,7 +1038,7 @@ class OrderProcess final : AstNDeleter { // NODE STATE // AstNodeModule::user3 -> int: Number of AstCFuncs created under this module // AstNode::user4 -> Used by V3Const::constifyExpensiveEdit - AstUser3InUse user3InUse; + const AstUser3InUse user3InUse; // STATE OrderGraph& m_graph; // The ordering graph diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 28e8775db..45f3727fd 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -226,8 +226,8 @@ class ParamProcessor final { // AstGenFor::user5() // bool True if processed // AstVar::user5() // bool True if constant propagated // AstCell::user5p() // string* Generate portion of hierarchical name - AstUser4InUse m_inuser4; - AstUser5InUse m_inuser5; + const AstUser4InUse m_inuser4; + const AstUser5InUse m_inuser5; // User1/2/3 used by constant function simulations // TYPES diff --git a/src/V3Partition.cpp b/src/V3Partition.cpp index 34980026d..3ea1bfd85 100644 --- a/src/V3Partition.cpp +++ b/src/V3Partition.cpp @@ -2566,7 +2566,7 @@ void V3Partition::go(V3Graph* mtasksp) { { // The V3InstrCount within LogicMTask will set user5 on each AST // node, to assert that we never count any node twice. - AstUser5InUse inUser5; + const AstUser5InUse inUser5; Vx2MTaskMap vx2mtask; for (V3GraphVertex* vxp = m_fineDepsGraphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) { diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp index 9ffda7800..30116e97e 100644 --- a/src/V3Premit.cpp +++ b/src/V3Premit.cpp @@ -44,7 +44,7 @@ class PremitAssignVisitor final : public AstNVisitor { private: // NODE STATE // AstVar::user3() // bool; occurs on LHS of current assignment - AstUser3InUse m_inuser3; + const AstUser3InUse m_inuser3; // STATE bool m_noopt = false; // Disable optimization of variables in this block @@ -93,8 +93,8 @@ private: // AstShiftL::user2() -> bool. True if converted to conditional // AstShiftR::user2() -> bool. True if converted to conditional // *::user3() -> See PremitAssignVisitor - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // STATE AstCFunc* m_cfuncp = nullptr; // Current block diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 7eb5c4750..e3b4ab315 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -37,7 +37,7 @@ private: // NODE STATE // Cleared on Netlist // AstClass::user1() -> bool. Set true to indicate needs randomize processing - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; using DerivedSet = std::unordered_set; using BaseToDerivedMap = std::unordered_map; @@ -119,7 +119,7 @@ private: // AstClass::user1() -> bool. Set true to indicate needs randomize processing // AstEnumDType::user2() -> AstVar*. Pointer to table with enum values // AstUser1InUse m_inuser1; (Allocated for use in RandomizeMarkVisitor) - AstUser2InUse m_inuser2; + const AstUser2InUse m_inuser2; // STATE size_t m_enumValueTabCount = 0; // Number of tables with enum values created diff --git a/src/V3Reloop.cpp b/src/V3Reloop.cpp index 0a923615c..6b3154f0b 100644 --- a/src/V3Reloop.cpp +++ b/src/V3Reloop.cpp @@ -45,7 +45,7 @@ class ReloopVisitor final : public AstNVisitor { private: // NODE STATE // AstCFunc::user1p -> Var* for temp var, 0=not set yet - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE VDouble0 m_statReloops; // Statistic tracking diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index 3d9d37fc1..788c2a617 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -41,8 +41,8 @@ private: // NODE STATE // AstVar::user1p -> AstVarScope replacement for this variable // AstTask::user2p -> AstTask*. Replacement task - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // TYPES // These cannot be unordered unless make a specialized hashing pair (gcc-8) diff --git a/src/V3Simulate.h b/src/V3Simulate.h index 727538ada..8b96b97a6 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -72,9 +72,9 @@ class SimulateVisitor VL_NOT_FINAL : public AstNVisitor { private: // NODE STATE // Cleared on each always/assignw - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; // Checking: // AstVar(Scope)::user1() -> VarUsage. Set true to indicate tracking as lvalue/rvalue diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index 81887f2b0..f2c24fd07 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -50,7 +50,7 @@ class SliceVisitor final : public AstNVisitor { // AstNodeAssign::user1() -> bool. True if find is complete // AstNodeUniop::user1() -> bool. True if find is complete // AstArraySel::user1p() -> AstVarRef. The VarRef that the final ArraySel points to - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNode* m_assignp = nullptr; // Assignment we are under diff --git a/src/V3Split.cpp b/src/V3Split.cpp index 61e193653..2e4e4608d 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -242,10 +242,10 @@ private: // AstVarScope::user2p -> Var SplitNodeVertex* for delayed assignment var, 0=not set yet // Ast*::user3p -> Statement SplitLogicVertex* (temporary only) // Ast*::user4 -> Current ordering number (reorderBlock usage) - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; protected: // STATE diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp index 9cd9765a8..bf7f0c0cc 100644 --- a/src/V3SplitAs.cpp +++ b/src/V3SplitAs.cpp @@ -128,7 +128,7 @@ class SplitAsVisitor final : public SplitAsBaseVisitor { private: // NODE STATE // AstAlways::user() -> bool. True if already processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE VDouble0 m_statSplits; // Statistic tracking diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 3541c63de..60c845d19 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -127,7 +127,7 @@ struct SplitVarImpl { // NODE STATE // AstNodeModule::user1() -> Block number counter for generating unique names - AstUser1InUse m_user1InUse; // Only used in SplitUnpackedVarVisitor + const AstUser1InUse m_user1InUse; // Only used in SplitUnpackedVarVisitor static AstNodeAssign* newAssign(FileLine* fileline, AstNode* lhsp, AstNode* rhsp, const AstVar* varp) { diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index a210403d6..356188cb4 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -227,8 +227,8 @@ private: // Passed to SubstUseVisitor // AstVar::user1p -> SubstVar* for usage var, 0=not set yet // AstVar::user2 -> int step number for last assignment, 0=not set yet - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // STATE std::vector m_entryps; // Nodes to delete when we are finished @@ -381,6 +381,6 @@ public: void V3Subst::substituteAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); - { SubstVisitor visitor{nodep}; } // Destruct before checking + { const SubstVisitor visitor{nodep}; } // Destruct before checking V3Global::dumpCheckGlobalTree("subst", 0, v3Global.opt.dumpTreeLevel(__FILE__) >= 3); } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 890af9975..c60db1737 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -98,9 +98,8 @@ private: // AstNodeFTask::user3p // AstScope* this FTask is under // AstNodeFTask::user4p // GraphFTaskVertex* this FTask is under // AstVar::user4p // GraphFTaskVertex* this variable is declared in - - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; // TYPES using VarToScopeMap = std::map, AstVarScope*>; @@ -370,7 +369,7 @@ struct TaskDpiUtils { class TaskGatherWrittenVisitor final : public AstNVisitor { // NODE STATE // AstVarScope::user5 -> Already considered variable - AstUser5InUse m_user5InUse; + const AstUser5InUse m_user5InUse; std::vector m_writtenVariables; // Variables written @@ -408,9 +407,8 @@ private: // Each funccall // to TaskRelinkVisitor: // AstVar::user2p // AstVarScope* to replace varref with - - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // TYPES enum InsertMode : uint8_t { diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 747ef9d3b..e7d17db0c 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -162,9 +162,9 @@ private: // AstVarScope::user1() // V3GraphVertex* for this node // AstCCall::user2() // bool; walked next list for other ccalls // Ast*::user3() // TraceActivityVertex* for this node - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; // AstUser4InUse In V3Hasher via V3DupFinder // STATE diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index c70942e29..a3eb01cf6 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -327,11 +327,11 @@ class TristateVisitor final : public TristateBaseVisitor { // See TristateGraph: // AstVar::user5p -> TristateVertex* for variable being built // AstStmt*::user5p -> TristateVertex* for this statement - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; - AstUser3InUse m_inuser3; - AstUser4InUse m_inuser4; - AstUser5InUse m_inuser5; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; + const AstUser3InUse m_inuser3; + const AstUser4InUse m_inuser4; + const AstUser5InUse m_inuser5; // TYPES using RefVec = std::vector; diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index 90b67a78e..1c2eedc90 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -240,10 +240,10 @@ private: // NODE STATE // Netlist: // AstVar::user1p -> UndrivenVar* for usage var, 0=not set yet - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // Each always: // AstNode::user2p -> UndrivenVar* for usage var, 0=not set yet - AstUser2InUse m_inuser2; + const AstUser2InUse m_inuser2; // STATE std::array, 3> m_entryps; // Nodes to delete when finished diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp index 70f4dc99f..ff88d14c6 100644 --- a/src/V3Unknown.cpp +++ b/src/V3Unknown.cpp @@ -49,8 +49,8 @@ private: // AstSel::user() -> bool. Set true if already processed // AstArraySel::user() -> bool. Set true if already processed // AstNode::user2p() -> AstIf* Inserted if assignment for conditional - AstUser1InUse m_inuser1; - AstUser2InUse m_inuser2; + const AstUser1InUse m_inuser1; + const AstUser2InUse m_inuser2; // STATE AstNodeModule* m_modp = nullptr; // Current module diff --git a/src/V3VariableOrder.cpp b/src/V3VariableOrder.cpp index e3df0d1d0..bf6d9c505 100644 --- a/src/V3VariableOrder.cpp +++ b/src/V3VariableOrder.cpp @@ -78,7 +78,7 @@ unsigned VarTspSorter::s_serialNext = 0; class VariableOrder final { // NODE STATE // AstVar::user1() -> attributes, via m_attributes - AstUser1InUse m_user1InUse; // AstVar + const AstUser1InUse m_user1InUse; // AstVar struct VarAttributes { uint32_t stratum; // Roughly equivalent to alignment requirement, to avoid padding diff --git a/src/V3WidthCommit.h b/src/V3WidthCommit.h index 77514ff3b..5dc34c028 100644 --- a/src/V3WidthCommit.h +++ b/src/V3WidthCommit.h @@ -67,7 +67,7 @@ public: class WidthCommitVisitor final : public AstNVisitor { // NODE STATE // AstVar::user1p -> bool, processed - AstUser1InUse m_inuser1; + const AstUser1InUse m_inuser1; // STATE AstNodeModule* m_modp = nullptr;