Internals: Use VL_RESTORER class to save/restore vars. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-08-24 21:13:28 -04:00
parent 4265f9499d
commit bed3101dfc
42 changed files with 253 additions and 364 deletions
+2 -5
View File
@@ -518,12 +518,11 @@ private:
}
}
virtual void visit(AstNodeModule* nodep) override {
AstNodeModule* origModp = m_modp;
VL_RESTORER(m_modp);
{
m_modp = nodep;
iterateChildren(nodep);
}
m_modp = origModp;
}
virtual void visit(AstCell* nodep) override {
if (nodep->modp()->user1()) { // Marked with inline request
@@ -638,7 +637,7 @@ private:
if (nodep->isTop()) { iterateChildren(nodep); }
}
virtual void visit(AstCell* nodep) override {
string oldScope = m_scope;
VL_RESTORER(m_scope);
if (m_scope.empty()) {
m_scope = nodep->name();
} else {
@@ -668,8 +667,6 @@ private:
nodep->addIntfRefp(new AstIntfRef(nodep->fileline(), m_scope));
// No need to iterate on interface cells
}
m_scope = oldScope;
}
virtual void visit(AstAssignVarScope* nodep) override {
// Reference