Internal scope cleanup. No functional change.

This commit is contained in:
Wilson Snyder 2020-11-13 21:12:18 -05:00
parent f7a5883205
commit 3e7013af31
2 changed files with 9 additions and 6 deletions

View File

@ -193,8 +193,8 @@ class InstDeVisitor : public AstNVisitor {
// Find all cells with arrays, and convert to non-arrayed
private:
// STATE
AstRange* m_cellRangep
= nullptr; // Range for arrayed instantiations, nullptr for normal instantiations
// Range for arrayed instantiations, nullptr for normal instantiations
AstRange* m_cellRangep = nullptr;
int m_instSelNum = 0; // Current instantiation count 0..N-1
InstDeModVarVisitor m_deModVars; // State of variables for current cell module

View File

@ -116,7 +116,8 @@ private:
// Now for each child cell, iterate the module this cell points to
for (AstNode* cellnextp = nodep->stmtsp(); cellnextp; cellnextp = cellnextp->nextp()) {
if (AstCell* cellp = VN_CAST(cellnextp, Cell)) {
VL_RESTORER(m_scopep);
VL_RESTORER(m_scopep); // Protects m_scopep set in called module
// which is "above" in this code, but later in code execution order
VL_RESTORER(m_aboveCellp);
VL_RESTORER(m_aboveScopep);
{
@ -329,9 +330,11 @@ private:
// VISITORS
virtual void visit(AstScope* nodep) override {
// Want to ignore blocks under it
m_scopep = nodep;
iterateChildren(nodep);
m_scopep = nullptr;
VL_RESTORER(m_scopep);
{
m_scopep = nodep;
iterateChildren(nodep);
}
}
virtual void movedDeleteOrIterate(AstNode* nodep) {