mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Make all expressions derive from AstNodeExpr (#3721).
Apart from the representational changes below, this patch renames AstNodeMath to AstNodeExpr, and AstCMath to AstCExpr. Now every expression (i.e.: those AstNodes that represent a [possibly void] value, with value being interpreted in a very general sense) has AstNodeExpr as a super class. This necessitates the introduction of an AstStmtExpr, which represents an expression in statement position, e.g : 'foo();' would be represented as AstStmtExpr(AstCCall(foo)). In exchange we can get rid of isStatement() in AstNodeStmt, which now really always represent a statement Peak memory consumption and verilation speed are not measurably changed. Partial step towards #3420
This commit is contained in:
@@ -39,7 +39,7 @@ VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
namespace {
|
||||
|
||||
// Create a DfgVertex out of a AstNodeMath. For most AstNodeMath subtypes, this can be done
|
||||
// Create a DfgVertex out of a AstNodeExpr. For most AstNodeExpr subtypes, this can be done
|
||||
// automatically. For the few special cases, we provide specializations below
|
||||
template <typename Vertex, typename Node>
|
||||
Vertex* makeVertex(const Node* nodep, DfgGraph& dfg) {
|
||||
@@ -132,7 +132,7 @@ class AstToDfgVisitor final : public VNVisitor {
|
||||
}
|
||||
|
||||
// Returns true if the expression cannot (or should not) be represented by DFG
|
||||
bool unhandled(AstNodeMath* nodep) {
|
||||
bool unhandled(AstNodeExpr* nodep) {
|
||||
// Short-circuiting if something was already unhandled
|
||||
if (!m_foundUnhandled) {
|
||||
// Impure nodes cannot be represented
|
||||
|
||||
Reference in New Issue
Block a user