Split long expression, throw error on unhandled type

Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
This commit is contained in:
Ryszard Rozak 2026-01-20 14:54:11 +01:00
parent 8ee53a8e80
commit 77fda9683d
1 changed files with 3 additions and 2 deletions

View File

@ -212,14 +212,15 @@ public:
currWhilep->addStmtsp(loopTestp);
AstArraySel* const lhsSelp
= new AstArraySel{flp, lhsp, readRefp->cloneTree(false)};
currWhilep->addStmtsp(getAssignStmtsp(lhsSelp, vscp, lhsVarRefp));
AstNodeStmt* const loopBodyp = getAssignStmtsp(lhsSelp, vscp, lhsVarRefp);
currWhilep->addStmtsp(loopBodyp);
AstAssign* const currIncrp = new AstAssign{
flp, new AstVarRef{flp, loopVarScopep, VAccess::WRITE},
new AstAdd{flp, readRefp->cloneTree(false), new AstConst{flp, 1}}};
currWhilep->addStmtsp(currIncrp);
return currInitp;
} else {
return nullptr;
lhsDtypep->v3fatalSrc("Unhandled type");
}
}
static AstNodeExpr* applySelects(AstNodeExpr* exprp,