From f7533010c66489398b7721213648ca7a44939859 Mon Sep 17 00:00:00 2001 From: Krzysztof Bieganski Date: Thu, 16 Jun 2022 00:11:03 +0200 Subject: [PATCH] Internals: Add `setNoopt()` function to `LifeVisitor` (#3468) --- src/V3Life.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 57ab3d0e5..814647cea 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -251,6 +251,7 @@ public: } // this->lifeDump(); } + void clear() { m_map.clear(); } // DEBUG void lifeDump() { UINFO(5, " LifeMap:" << endl); @@ -283,6 +284,10 @@ private: // METHODS VL_DEBUG_FUNC; // Declare debug() + void setNoopt() { + m_noopt = true; + m_lifep->clear(); + } // VISITORS virtual void visit(AstVarRef* nodep) override { @@ -389,7 +394,7 @@ private: const bool prev_noopt = m_noopt; { m_lifep = bodyLifep; - m_noopt = true; + setNoopt(); iterateAndNextNull(nodep->stmtsp()); m_lifep = prevLifep; m_noopt = prev_noopt;