Remove redundant 'virtual' keywords from overridden methods

'virtual' is redundant when 'override' is present, so keep only
'override'.

Add t/t_dist_cppstyle.pl to check for this.
This commit is contained in:
Geza Lore
2022-09-16 15:19:38 +01:00
parent d16619fe86
commit 0c70a0dcbf
99 changed files with 4454 additions and 4525 deletions
+8 -8
View File
@@ -123,12 +123,12 @@ private:
}
// VISITORS
virtual void visit(AstNetlist* nodep) override {
void visit(AstNetlist* nodep) override {
iterateChildrenConst(nodep);
moveVarScopes();
}
virtual void visit(AstCFunc* nodep) override {
void visit(AstCFunc* nodep) override {
UINFO(4, " CFUNC " << nodep << endl);
VL_RESTORER(m_cfuncp);
VL_RESTORER(m_nodeDepth);
@@ -140,12 +140,12 @@ private:
}
}
virtual void visit(AstCCall* nodep) override {
void visit(AstCCall* nodep) override {
m_cfuncp->user1(true); // Mark caller as not a leaf function
iterateChildrenConst(nodep);
}
virtual void visit(AstNodeAssign* nodep) override {
void visit(AstNodeAssign* nodep) override {
// Analyze RHS first so "a = a + 1" is detected as a read before write
iterate(nodep->rhsp());
// For now we only consider an assignment that is directly under the function, (in
@@ -163,7 +163,7 @@ private:
iterate(nodep->lhsp());
}
virtual void visit(AstVarScope* nodep) override {
void visit(AstVarScope* nodep) override {
if (!nodep->varp()->isPrimaryIO() // Not an IO the user wants to interact with
&& !nodep->varp()->isSigPublic() // Not something the user wants to interact with
&& !nodep->varp()->isFuncLocal() // Not already a function local (e.g.: argument)
@@ -177,7 +177,7 @@ private:
// No iterate; Don't want varrefs under it (e.g.: in child dtype?)
}
virtual void visit(AstVarRef* nodep) override {
void visit(AstVarRef* nodep) override {
UASSERT_OBJ(m_cfuncp, nodep, "AstVarRef not under function");
AstVarScope* const varScopep = nodep->varScopep();
@@ -201,7 +201,7 @@ private:
// No iterate; Don't want varrefs under it (e.g.: in child dtype?)
}
virtual void visit(AstNode* nodep) override {
void visit(AstNode* nodep) override {
++m_nodeDepth;
iterateChildrenConst(nodep);
--m_nodeDepth;
@@ -210,7 +210,7 @@ private:
public:
// CONSTRUCTORS
explicit LocalizeVisitor(AstNetlist* nodep) { iterate(nodep); }
virtual ~LocalizeVisitor() override {
~LocalizeVisitor() override {
V3Stats::addStat("Optimizations, Vars localized", m_statLocVars);
}
};