Improve V3LifePost to not require AstAssignPre/AssignPost (#6306)

Rewrote V3LifePost to not depend on having AstAssignPre and
AstAssignPost types, but work with generic AstNodeAssign. There is an
extra flag in AstVarScope to denote it's part of an NBA and should be
considered.

Step towards #6280.
This commit is contained in:
Geza Lore
2025-08-19 00:11:14 +01:00
committed by GitHub
parent c90f9e53b7
commit c9a6d06544
4 changed files with 217 additions and 253 deletions
+3
View File
@@ -585,6 +585,9 @@ class DelayedVisitor final : public VNVisitor {
const std::string name = "__Vdly__" + vscp->varp()->shortName();
AstVarScope* const shadowVscp = createTemp(flp, scopep, name, vscp->dtypep());
vscpInfo.shadowVariableKit().vscp = shadowVscp;
// Mark both for V3LifePsot
vscp->optimizeLifePost(true);
shadowVscp->optimizeLifePost(true);
// Create the AstActive for the Pre/Post logic
AstActive* const activep = new AstActive{flp, "nba-shadow-variable", vscpInfo.senTreep()};
activep->senTreeStorep(vscpInfo.senTreep());