Internals: Mark all visit() with VL_OVERRIDE. Closes #2132.

* Add VL_OVERRIDE macro so that compiler can tell my typo when trying to override a function.

* Mark visit() with VL_OVERRIDE. No functional change intended.
This commit is contained in:
Yutetsu TAKATSUKASA
2020-01-21 17:35:56 -05:00
committed by Wilson Snyder
parent 8e26bdd098
commit fbdf5f2dad
71 changed files with 1359 additions and 1357 deletions
+12 -12
View File
@@ -107,7 +107,7 @@ private:
}
// VISITORS
virtual void visit(AstNodeModule* nodep) {
virtual void visit(AstNodeModule* nodep) VL_OVERRIDE {
if (nodep->dead()) return;
AstNodeModule* origModp = m_modp;
int origRepeatNum = m_modRepeatNum;
@@ -119,18 +119,18 @@ private:
m_modp = origModp;
m_modRepeatNum = origRepeatNum;
}
virtual void visit(AstNodeFTask* nodep) {
virtual void visit(AstNodeFTask* nodep) VL_OVERRIDE {
m_ftaskp = nodep;
iterateChildren(nodep);
m_ftaskp = NULL;
}
virtual void visit(AstBegin* nodep) {
virtual void visit(AstBegin* nodep) VL_OVERRIDE {
UINFO(8," "<<nodep<<endl);
m_beginStack.push_back(nodep);
iterateChildren(nodep);
m_beginStack.pop_back();
}
virtual void visit(AstRepeat* nodep) {
virtual void visit(AstRepeat* nodep) VL_OVERRIDE {
// So later optimizations don't need to deal with them,
// REPEAT(count,body) -> loop=count,WHILE(loop>0) { body, loop-- }
// Note var can be signed or unsigned based on original number.
@@ -163,7 +163,7 @@ private:
nodep->replaceWith(newp);
VL_DO_DANGLING(nodep->deleteTree(), nodep);
}
virtual void visit(AstWhile* nodep) {
virtual void visit(AstWhile* nodep) VL_OVERRIDE {
// Don't need to track AstRepeat/AstFor as they have already been converted
AstWhile* lastLoopp = m_loopp;
bool lastInc = m_loopInc;
@@ -177,7 +177,7 @@ private:
m_loopInc = lastInc;
m_loopp = lastLoopp;
}
virtual void visit(AstReturn* nodep) {
virtual void visit(AstReturn* nodep) VL_OVERRIDE {
iterateChildren(nodep);
AstFunc* funcp = VN_CAST(m_ftaskp, Func);
if (!m_ftaskp) {
@@ -200,7 +200,7 @@ private:
}
nodep->unlinkFrBack(); VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
virtual void visit(AstBreak* nodep) {
virtual void visit(AstBreak* nodep) VL_OVERRIDE {
iterateChildren(nodep);
if (!m_loopp) { nodep->v3error("break isn't underneath a loop"); }
else {
@@ -210,7 +210,7 @@ private:
}
nodep->unlinkFrBack(); VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
virtual void visit(AstContinue* nodep) {
virtual void visit(AstContinue* nodep) VL_OVERRIDE {
iterateChildren(nodep);
if (!m_loopp) { nodep->v3error("continue isn't underneath a loop"); }
else {
@@ -221,7 +221,7 @@ private:
}
nodep->unlinkFrBack(); VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
virtual void visit(AstDisable* nodep) {
virtual void visit(AstDisable* nodep) VL_OVERRIDE {
UINFO(8," DISABLE "<<nodep<<endl);
iterateChildren(nodep);
AstBegin* beginp = NULL;
@@ -244,12 +244,12 @@ private:
nodep->unlinkFrBack(); VL_DO_DANGLING(pushDeletep(nodep), nodep);
//if (debug()>=9) { UINFO(0,"\n"); beginp->dumpTree(cout, " labelo: "); }
}
virtual void visit(AstVarRef* nodep) {
virtual void visit(AstVarRef* nodep) VL_OVERRIDE {
if (m_loopInc && nodep->varp()) nodep->varp()->usedLoopIdx(true);
}
virtual void visit(AstConst* nodep) {}
virtual void visit(AstNode* nodep) {
virtual void visit(AstConst* nodep) VL_OVERRIDE {}
virtual void visit(AstNode* nodep) VL_OVERRIDE {
iterateChildren(nodep);
}
public: