Give iterated variables in foreach loops VAUTOM lifetimes (#4265)
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
This commit is contained in:
parent
0e24f36fef
commit
545caba720
|
|
@ -4680,6 +4680,7 @@ private:
|
||||||
FileLine* const fl = varp->fileline();
|
FileLine* const fl = varp->fileline();
|
||||||
auto* const whilep = new AstWhile{
|
auto* const whilep = new AstWhile{
|
||||||
fl, condp, bodysp, new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, incp}};
|
fl, condp, bodysp, new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, incp}};
|
||||||
|
varp->lifetime(VLifetime::AUTOMATIC);
|
||||||
AstNode* const stmtsp = varp; // New statements for under new Begin
|
AstNode* const stmtsp = varp; // New statements for under new Begin
|
||||||
stmtsp->addNext(new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, leftp});
|
stmtsp->addNext(new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, leftp});
|
||||||
stmtsp->addNext(whilep);
|
stmtsp->addNext(whilep);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue