Handle structs in Rd updates

Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
This commit is contained in:
Ryszard Rozak 2026-01-20 15:55:11 +01:00
parent 77fda9683d
commit 55c4a11116
1 changed files with 9 additions and 1 deletions

View File

@ -188,7 +188,15 @@ public:
return new AstAssign{flp, lhsp, forcedUpdate(vscp, lhsp, lhsVarRefp)};
} else if (const AstStructDType* const structDtypep
= VN_CAST(lhsDtypep, StructDType)) {
return nullptr;
AstNodeStmt* stmtsp = nullptr;
for (AstMemberDType* mdtp = structDtypep->membersp(); mdtp;
mdtp = VN_AS(mdtp->nextp(), MemberDType)) {
AstStructSel* const structSelp = new AstStructSel{flp, lhsp, mdtp->name()};
structSelp->dtypep(mdtp);
AstNodeStmt* const memberStmtp = getAssignStmtsp(structSelp, vscp, lhsVarRefp);
stmtsp = stmtsp ? stmtsp->addNext(memberStmtp) : memberStmtp;
}
return stmtsp;
} else if (const AstUnpackArrayDType* const arrayDtypep
= VN_CAST(lhsDtypep, UnpackArrayDType)) {
AstVar* const loopVarp = new AstVar{flp, VVarType::MODULETEMP,