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
+12 -10
View File
@@ -362,12 +362,13 @@ private:
}
virtual void visit(AstActive* nodep) override {
m_activep = nodep;
bool oldinit = m_inInitial;
m_inInitial = nodep->hasInitial();
AstNode::user3ClearTree(); // Two sets to same variable in different
// actives must use different vars.
iterateChildren(nodep);
m_inInitial = oldinit;
VL_RESTORER(m_inInitial);
{
m_inInitial = nodep->hasInitial();
// Two sets to same variable in different actives must use different vars.
AstNode::user3ClearTree();
iterateChildren(nodep);
}
}
virtual void visit(AstAssignDly* nodep) override {
m_inDly = true;
@@ -465,10 +466,11 @@ private:
"For statements should have been converted to while statements in V3Begin");
}
virtual void visit(AstWhile* nodep) override {
bool oldloop = m_inLoop;
m_inLoop = true;
iterateChildren(nodep);
m_inLoop = oldloop;
VL_RESTORER(m_inLoop);
{
m_inLoop = true;
iterateChildren(nodep);
}
}
//--------------------