mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 18:42:58 +02:00
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:
committed by
Wilson Snyder
parent
8e26bdd098
commit
fbdf5f2dad
+14
-14
@@ -266,11 +266,11 @@ private:
|
||||
}
|
||||
|
||||
// VISITORS
|
||||
virtual void visit(AstNetlist* nodep) {
|
||||
virtual void visit(AstNetlist* nodep) VL_OVERRIDE {
|
||||
// Modules must be done in top-down-order
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstNodeModule* nodep) {
|
||||
virtual void visit(AstNodeModule* nodep) VL_OVERRIDE {
|
||||
if (nodep->dead()) {
|
||||
UINFO(4," MOD-dead. "<<nodep<<endl); // Marked by LinkDot
|
||||
} else if (nodep->recursiveClone()) {
|
||||
@@ -288,7 +288,7 @@ private:
|
||||
UINFO(4," MOD-dead? "<<nodep<<endl); // Should have been done by now, if not dead
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCell* nodep) {
|
||||
virtual void visit(AstCell* nodep) VL_OVERRIDE {
|
||||
// Must do ifaces first, so push to list and do in proper order
|
||||
string* genHierNamep = new string(m_generateHierName);
|
||||
nodep->user5p(genHierNamep);
|
||||
@@ -296,7 +296,7 @@ private:
|
||||
}
|
||||
|
||||
// Make sure all parameters are constantified
|
||||
virtual void visit(AstVar* nodep) {
|
||||
virtual void visit(AstVar* nodep) VL_OVERRIDE {
|
||||
if (!nodep->user5SetOnce()) { // Process once
|
||||
iterateChildren(nodep);
|
||||
if (nodep->isParam()) {
|
||||
@@ -322,7 +322,7 @@ private:
|
||||
}
|
||||
}
|
||||
// Make sure varrefs cause vars to constify before things above
|
||||
virtual void visit(AstVarRef* nodep) {
|
||||
virtual void visit(AstVarRef* nodep) VL_OVERRIDE {
|
||||
if (nodep->varp()) iterate(nodep->varp());
|
||||
}
|
||||
bool ifaceParamReplace(AstVarXRef* nodep, AstNode* candp) {
|
||||
@@ -342,7 +342,7 @@ private:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
virtual void visit(AstVarXRef* nodep) {
|
||||
virtual void visit(AstVarXRef* nodep) VL_OVERRIDE {
|
||||
// Check to see if the scope is just an interface because interfaces are special
|
||||
string dotted = nodep->dotted();
|
||||
if (!dotted.empty() && nodep->varp() && nodep->varp()->isParam()) {
|
||||
@@ -382,7 +382,7 @@ private:
|
||||
nodep->varp(NULL); // Needs relink, as may remove pointed-to var
|
||||
}
|
||||
|
||||
virtual void visit(AstUnlinkedRef* nodep) {
|
||||
virtual void visit(AstUnlinkedRef* nodep) VL_OVERRIDE {
|
||||
AstVarXRef* varxrefp = VN_CAST(nodep->op1p(), VarXRef);
|
||||
AstNodeFTaskRef* taskrefp = VN_CAST(nodep->op1p(), NodeFTaskRef);
|
||||
if (varxrefp) {
|
||||
@@ -403,7 +403,7 @@ private:
|
||||
nodep->replaceWith(nodep->op1p()->unlinkFrBack());
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
}
|
||||
virtual void visit(AstCellArrayRef* nodep) {
|
||||
virtual void visit(AstCellArrayRef* nodep) VL_OVERRIDE {
|
||||
V3Const::constifyParamsEdit(nodep->selp());
|
||||
if (const AstConst* constp = VN_CAST(nodep->selp(), Const)) {
|
||||
string index = AstNode::encodeNumber(constp->toSInt());
|
||||
@@ -424,7 +424,7 @@ private:
|
||||
}
|
||||
|
||||
// Generate Statements
|
||||
virtual void visit(AstGenerate* nodep) {
|
||||
virtual void visit(AstGenerate* nodep) VL_OVERRIDE {
|
||||
if (debug()>=9) nodep->dumpTree(cout, "-genin: ");
|
||||
iterateChildren(nodep);
|
||||
// After expanding the generate, all statements under it can be moved
|
||||
@@ -438,7 +438,7 @@ private:
|
||||
}
|
||||
VL_DO_DANGLING(nodep->deleteTree(), nodep);
|
||||
}
|
||||
virtual void visit(AstGenIf* nodep) {
|
||||
virtual void visit(AstGenIf* nodep) VL_OVERRIDE {
|
||||
UINFO(9," GENIF "<<nodep<<endl);
|
||||
iterateAndNextNull(nodep->condp());
|
||||
// We suppress errors when widthing params since short-circuiting in
|
||||
@@ -468,7 +468,7 @@ private:
|
||||
//! @todo Unlike generated IF, we don't have to worry about short-circuiting the conditional
|
||||
//! expression, since this is currently restricted to simple comparisons. If we ever do
|
||||
//! move to more generic constant expressions, such code will be needed here.
|
||||
virtual void visit(AstBegin* nodep) {
|
||||
virtual void visit(AstBegin* nodep) VL_OVERRIDE {
|
||||
if (nodep->genforp()) {
|
||||
AstGenFor* forp = VN_CAST(nodep->genforp(), GenFor);
|
||||
UASSERT_OBJ(forp, nodep, "Non-GENFOR under generate-for BEGIN");
|
||||
@@ -501,10 +501,10 @@ private:
|
||||
m_generateHierName = rootHierName;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstGenFor* nodep) {
|
||||
virtual void visit(AstGenFor* nodep) VL_OVERRIDE {
|
||||
nodep->v3fatalSrc("GENFOR should have been wrapped in BEGIN");
|
||||
}
|
||||
virtual void visit(AstGenCase* nodep) {
|
||||
virtual void visit(AstGenCase* nodep) VL_OVERRIDE {
|
||||
UINFO(9," GENCASE "<<nodep<<endl);
|
||||
AstNode* keepp = NULL;
|
||||
iterateAndNextNull(nodep->exprp());
|
||||
@@ -557,7 +557,7 @@ private:
|
||||
}
|
||||
|
||||
// Default: Just iterate
|
||||
virtual void visit(AstNode* nodep) {
|
||||
virtual void visit(AstNode* nodep) VL_OVERRIDE {
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user