diff --git a/src/V3Split.cpp b/src/V3Split.cpp index ef7d848c5..f7eedfee3 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -457,7 +457,7 @@ public: // METHODS protected: - void makeRvalueEdges(SplitVarStdVertex* vstdp) { + virtual void makeRvalueEdges(SplitVarStdVertex* vstdp) VL_OVERRIDE { for (VStack::iterator it = m_stmtStackps.begin(); it != m_stmtStackps.end(); ++it) { new SplitRVEdge(&m_graph, *it, vstdp); } @@ -876,7 +876,7 @@ public: // METHODS protected: - void makeRvalueEdges(SplitVarStdVertex* vstdp) { + virtual void makeRvalueEdges(SplitVarStdVertex* vstdp) VL_OVERRIDE { // Each 'if' depends on rvalues in its own conditional ONLY, // not rvalues in the if/else bodies. for (VStack::const_iterator it = m_stmtStackps.begin(); it != m_stmtStackps.end(); ++it) { diff --git a/src/astgen b/src/astgen index fcf7f718f..d5f6af222 100644 --- a/src/astgen +++ b/src/astgen @@ -627,7 +627,7 @@ sub tree_base { # saves one comparison. if ($out_for_type_sc[0]) { # Short-circuited types $self->print(" // Generated by astgen with short-circuiting\n", - " virtual void visit(Ast${type}* nodep) {\n", + " virtual void visit(Ast${type}* nodep) VL_OVERRIDE {\n", " iterateAndNextNull(nodep->lhsp());\n", @out_for_type_sc); $self->print(" iterateAndNextNull(nodep->rhsp());\n", @@ -638,8 +638,9 @@ sub tree_base { } elsif ($out_for_type[0]) { # Other types with something to print my $skip = $self->{tree_skip_visit}{$type}; my $gen = $skip ? "Gen" : ""; + my $override = $skip ? "" : " VL_OVERRIDE"; $self->print(" // Generated by astgen\n", - " virtual void visit$gen(Ast${type}* nodep) {\n", + " virtual void visit$gen(Ast${type}* nodep)${override} {\n", ($skip?"": " iterateChildren(nodep);\n"), @out_for_type,