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
@@ -124,7 +124,7 @@ private:
}
// VISITORS
virtual void visit(AstNodeSel* nodep) {
virtual void visit(AstNodeSel* nodep) VL_OVERRIDE {
// This covers both AstArraySel and AstWordSel
//
// If some vector is a bazillion dwords long, and we're selecting 1
@@ -135,7 +135,7 @@ private:
VisitBase vb(this, nodep);
iterateAndNextNull(nodep->bitp());
}
virtual void visit(AstSel* nodep) {
virtual void visit(AstSel* nodep) VL_OVERRIDE {
// Similar to AstNodeSel above, a small select into a large vector
// is not expensive. Count the cost of the AstSel itself (scales with
// its width) and the cost of the lsbp() and widthp() nodes, but not
@@ -144,13 +144,13 @@ private:
iterateAndNextNull(nodep->lsbp());
iterateAndNextNull(nodep->widthp());
}
virtual void visit(AstSliceSel* nodep) {
virtual void visit(AstSliceSel* nodep) VL_OVERRIDE {
nodep->v3fatalSrc("AstSliceSel unhandled");
}
virtual void visit(AstMemberSel* nodep) {
virtual void visit(AstMemberSel* nodep) VL_OVERRIDE {
nodep->v3fatalSrc("AstMemberSel unhandled");
}
virtual void visit(AstConcat* nodep) {
virtual void visit(AstConcat* nodep) VL_OVERRIDE {
// Nop.
//
// Ignore concat. The problem with counting concat is that when we
@@ -170,7 +170,7 @@ private:
// the widths of the operands (ignored here).
markCost(nodep);
}
virtual void visit(AstNodeIf* nodep) {
virtual void visit(AstNodeIf* nodep) VL_OVERRIDE {
VisitBase vb(this, nodep);
iterateAndNextNull(nodep->condp());
uint32_t savedCount = m_instrCount;
@@ -195,7 +195,7 @@ private:
if (nodep->ifsp()) nodep->ifsp()->user4(0); // Don't dump it
}
}
virtual void visit(AstNodeCond* nodep) {
virtual void visit(AstNodeCond* nodep) VL_OVERRIDE {
// Just like if/else above, the ternary operator only evaluates
// one of the two expressions, so only count the max.
VisitBase vb(this, nodep);
@@ -220,7 +220,7 @@ private:
if (nodep->expr2p()) nodep->expr2p()->user4(0); // Don't dump it
}
}
virtual void visit(AstActive* nodep) {
virtual void visit(AstActive* nodep) VL_OVERRIDE {
// You'd think that the OrderLogicVertex's would be disjoint trees
// of stuff in the AST, but it isn't so: V3Order makes an
// OrderLogicVertex for each ACTIVE, and then also makes an
@@ -236,14 +236,14 @@ private:
markCost(nodep);
UASSERT_OBJ(nodep == m_startNodep, nodep, "Multiple actives, or not start node");
}
virtual void visit(AstCCall* nodep) {
virtual void visit(AstCCall* nodep) VL_OVERRIDE {
VisitBase vb(this, nodep);
iterateChildren(nodep);
m_tracingCall = true;
iterate(nodep->funcp());
UASSERT_OBJ(!m_tracingCall, nodep, "visit(AstCFunc) should have cleared m_tracingCall.");
}
virtual void visit(AstCFunc* nodep) {
virtual void visit(AstCFunc* nodep) VL_OVERRIDE {
// Don't count a CFunc other than by tracing a call or counting it
// from the root
UASSERT_OBJ(m_tracingCall || nodep == m_startNodep, nodep,
@@ -257,7 +257,7 @@ private:
}
m_inCFunc = saved_inCFunc;
}
virtual void visit(AstNode* nodep) {
virtual void visit(AstNode* nodep) VL_OVERRIDE {
VisitBase vb(this, nodep);
iterateChildren(nodep);
}
@@ -289,7 +289,7 @@ public:
private:
// METHODS
string indent() { return string(m_depth, ':')+" "; }
virtual void visit(AstNode* nodep) {
virtual void visit(AstNode* nodep) VL_OVERRIDE {
++m_depth;
if (unsigned costPlus1 = nodep->user4()) {
*m_osp <<" "<<indent()