mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +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:
+3
-1
@@ -69,7 +69,9 @@ class CombineVisitor final : VNVisitor {
|
||||
if (funcp->emptyBody()) {
|
||||
// Delete call sites
|
||||
for (AstCCall* const callp : m_callSites(funcp)) {
|
||||
VL_DO_DANGLING(callp->unlinkFrBack()->deleteTree(), callp);
|
||||
UASSERT_OBJ(VN_IS(callp->backp(), StmtExpr), callp,
|
||||
"Deleting non-statement call");
|
||||
VL_DO_DANGLING(callp->backp()->unlinkFrBack()->deleteTree(), callp);
|
||||
}
|
||||
m_callSites(funcp).clear();
|
||||
// Remove from list
|
||||
|
||||
Reference in New Issue
Block a user