diff --git a/src/V3GraphPathChecker.cpp b/src/V3GraphPathChecker.cpp index f59d76cb4..aeed65c71 100644 --- a/src/V3GraphPathChecker.cpp +++ b/src/V3GraphPathChecker.cpp @@ -35,7 +35,7 @@ struct GraphPCNode final { // // Unlike the LogicMTasks's, we have no cost info for the generic graph // accepted by GraphPathChecker, so assume each node has unit cost. - std::array m_cp; + std::array m_cp = {}; // Detect if we've seen this node before in a given recursive // operation. We'll use this in pathExistsInternal() to avoid checking @@ -44,9 +44,7 @@ struct GraphPCNode final { uint64_t m_seenAtGeneration = 0; // CONSTRUCTORS - GraphPCNode() { - for (unsigned int& w : m_cp) w = 0; - } + GraphPCNode() {} ~GraphPCNode() = default; }; diff --git a/src/V3OrderParallel.cpp b/src/V3OrderParallel.cpp index 52057018e..c640df090 100644 --- a/src/V3OrderParallel.cpp +++ b/src/V3OrderParallel.cpp @@ -332,7 +332,7 @@ private: // Cost of critical paths going FORWARD from graph-start to the start // of this vertex, and also going REVERSE from the end of the graph to // the end of the vertex. Same units as m_cost. - std::array m_critPathCost; + std::array m_critPathCost = {}; const uint32_t m_id; // Unique LogicMTask ID number static uint32_t s_nextId; // Next ID number to use @@ -361,7 +361,6 @@ public: : V3GraphVertex{graphp} , m_id{s_nextId++} { UASSERT(s_nextId < 0xFFFFFFFFUL, "Too many mTaskGraphp"); - for (uint64_t& item : m_critPathCost) item = 0; if (mVtxp) { m_mVertices.linkBack(mVtxp); if (const OrderLogicVertex* const olvp = mVtxp->logicp()) { diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp index cee37d85a..1baaadcf1 100644 --- a/src/V3Stats.cpp +++ b/src/V3Stats.cpp @@ -34,11 +34,11 @@ V3Mutex V3Stats::s_mutex; class StatsVisitor final : public VNVisitorConst { struct Counters final { // Nodes of given type - uint64_t m_statTypeCount[VNType::_ENUM_END]; + std::array m_statTypeCount = {}; // Nodes of given type with given type immediate child - uint64_t m_statAbove[VNType::_ENUM_END][VNType::_ENUM_END]; + std::array, VNType::_ENUM_END> m_statAbove = {}; // Prediction of given type - uint64_t m_statPred[VBranchPred::_ENUM_END]; + std::array m_statPred = {}; }; // STATE @@ -103,9 +103,6 @@ public: : m_fastOnly{fastOnly} , m_accump{fastOnly ? &m_dumpster : &m_counters} { UINFO(9, "Starting stats, fastOnly=" << fastOnly); - memset(&m_counters, 0, sizeof(m_counters)); - memset(&m_dumpster, 0, sizeof(m_dumpster)); - iterateConst(nodep); // Shorthand diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index 800b367c3..7f1d5b21c 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -293,7 +293,7 @@ class UndrivenVisitor final : public VNVisitorConst { const VNUser2InUse m_inuser2; // STATE - std::array, 3> m_entryps; // Nodes to delete when finished + std::array, 3> m_entryps = {}; // Nodes to delete when finished bool m_inBBox = false; // In black box; mark as driven+used bool m_inContAssign = false; // In continuous assignment bool m_inInitialStatic = false; // In InitialStatic