Internals: Use and enforce class final for ~5% performance boost.

This commit is contained in:
Wilson Snyder
2020-11-18 21:32:16 -05:00
parent c0888c1b0f
commit b6ded59c2b
224 changed files with 976 additions and 949 deletions
+3 -3
View File
@@ -103,7 +103,7 @@ std::ostream& operator<<(std::ostream& str, const Determ& rhs) {
//######################################################################
// Width state, as a visitor of each AstNode
class WidthVP {
class WidthVP final {
// Parameters to pass down hierarchy with visit functions.
AstNodeDType* m_dtypep; // Parent's data type to resolve to
Stage m_stage; // If true, report errors
@@ -164,7 +164,7 @@ std::ostream& operator<<(std::ostream& str, const WidthVP* vup) {
//######################################################################
class WidthClearVisitor {
class WidthClearVisitor final {
// Rather than a AstNVisitor, can just quickly touch every node
void clearWidthRecurse(AstNode* nodep) {
for (; nodep; nodep = nodep->nextp()) {
@@ -188,7 +188,7 @@ public:
//######################################################################
class WidthVisitor : public AstNVisitor {
class WidthVisitor final : public AstNVisitor {
private:
// TYPES
typedef std::map<std::pair<const AstNodeDType*, AstAttrType>, AstVar*> TableMap;