Add AstNode::foreach method for simple pre-order traversal (#3276)

This commit is contained in:
Geza Lore
2022-01-09 22:34:10 +00:00
committed by GitHub
parent 50094ca296
commit 64a6e1ac8b
15 changed files with 207 additions and 317 deletions
+1 -3
View File
@@ -32,7 +32,6 @@
#include "V3Global.h"
#include "V3Ast.h"
#include "V3Changed.h"
#include "V3EmitCBase.h"
#include <algorithm>
@@ -154,8 +153,7 @@ private:
// Later code will expand words which adds to GCC compile time,
// so add penalty based on word width also
const EmitCBaseCounterVisitor visitor{initp};
m_statep->m_numStmts += visitor.count() + m_varEqnp->widthWords();
m_statep->m_numStmts += initp->nodeCount() + m_varEqnp->widthWords();
}
virtual void visit(AstBasicDType*) override { //