From 8b8ebb0e4322c4d0a588b727b1ac7653e2c7016a Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 5 Dec 2020 18:53:48 -0500 Subject: [PATCH] Internals: Use restorer. No functional change. --- src/V3Width.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 75244a44d..66abdc666 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -4407,8 +4407,8 @@ private: virtual void visit(AstWith* nodep) override { // Should otherwise be underneath a method call AstNodeDType* vdtypep = m_vup->dtypeNullSkipRefp(); - VL_RESTORER(m_withp); { + VL_RESTORER(m_withp); m_withp = nodep; userIterateChildren(nodep->indexArgRefp(), nullptr); userIterateChildren(nodep->valueArgRefp(), nullptr); @@ -5908,50 +5908,45 @@ private: AstNode* userIterateSubtreeReturnEdits(AstNode* nodep, WidthVP* vup) { if (!nodep) return nullptr; - WidthVP* saveVup = m_vup; AstNode* ret; { + VL_RESTORER(m_vup); m_vup = vup; ret = iterateSubtreeReturnEdits(nodep); } - m_vup = saveVup; return ret; } void userIterate(AstNode* nodep, WidthVP* vup) { if (!nodep) return; - WidthVP* saveVup = m_vup; { + VL_RESTORER(m_vup); m_vup = vup; iterate(nodep); } - m_vup = saveVup; } void userIterateAndNext(AstNode* nodep, WidthVP* vup) { if (!nodep) return; - WidthVP* saveVup = m_vup; { + VL_RESTORER(m_vup); m_vup = vup; iterateAndNextNull(nodep); } - m_vup = saveVup; } void userIterateChildren(AstNode* nodep, WidthVP* vup) { if (!nodep) return; - WidthVP* saveVup = m_vup; { + VL_RESTORER(m_vup); m_vup = vup; iterateChildren(nodep); } - m_vup = saveVup; } void userIterateChildrenBackwards(AstNode* nodep, WidthVP* vup) { if (!nodep) return; - WidthVP* saveVup = m_vup; { + VL_RESTORER(m_vup); m_vup = vup; iterateChildrenBackwards(nodep); } - m_vup = saveVup; } public: