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
+3 -6
View File
@@ -68,25 +68,22 @@ private:
// VISITORS
virtual void visit(AstNodeModule* nodep) override {
UINFO(4, " MOD " << nodep << endl);
AstNodeModule* origModp = m_modp;
VL_RESTORER(m_modp);
{
m_modp = nodep;
m_deepNum = 0;
iterateChildren(nodep);
}
m_modp = origModp;
}
virtual void visit(AstCFunc* nodep) override {
// We recurse into this.
int lastDepth = m_depth;
AstCFunc* lastFuncp = m_funcp;
VL_RESTORER(m_depth);
VL_RESTORER(m_funcp);
{
m_depth = 0;
m_funcp = nodep;
iterateChildren(nodep);
}
m_depth = lastDepth;
m_funcp = lastFuncp;
}
void visitStmt(AstNodeStmt* nodep) {
m_depth++;