Internals: Add AstLoop statement constructor. No functional change.
This commit is contained in:
parent
e65f052abf
commit
9155e2529b
|
|
@ -795,8 +795,10 @@ class AstLoop final : public AstNodeStmt {
|
|||
// @astgen op2 := contsp : List[AstNode] // Empty after LinkJump
|
||||
VOptionBool m_unroll; // Full, none, or default unrolling
|
||||
public:
|
||||
explicit AstLoop(FileLine* fl)
|
||||
: ASTGEN_SUPER_Loop(fl) {}
|
||||
explicit AstLoop(FileLine* fl, AstNode* stmtsp = nullptr)
|
||||
: ASTGEN_SUPER_Loop(fl) {
|
||||
addStmtsp(stmtsp);
|
||||
}
|
||||
ASTGEN_MEMBERS_AstLoop;
|
||||
void dump(std::ostream& str) const override;
|
||||
void dumpJson(std::ostream& str) const override;
|
||||
|
|
|
|||
|
|
@ -3561,8 +3561,7 @@ statement_item<nodeStmtp>: // IEEE: statement_item
|
|||
//
|
||||
// do/for/forever/while loops all modelled as AstLoop
|
||||
| yDO stmt yWHILE '(' expr ')' ';'
|
||||
{ AstLoop* const loopp = new AstLoop{$1};
|
||||
loopp->addStmtsp($2);
|
||||
{ AstLoop* const loopp = new AstLoop{$1, $2};
|
||||
loopp->addContsp(new AstLoopTest{$<fl>5, loopp, $5});
|
||||
$$ = loopp; }
|
||||
| yFOR '(' { VARRESET_NONLIST(UNKNOWN); } for_initializationE ';' exprE ';' for_stepE ')' stmt
|
||||
|
|
@ -3574,8 +3573,7 @@ statement_item<nodeStmtp>: // IEEE: statement_item
|
|||
blockp->addStmtsp(loopp);
|
||||
$$ = blockp; }
|
||||
| yFOREVER stmt
|
||||
{ AstLoop* const loopp = new AstLoop{$1};
|
||||
loopp->addStmtsp($2);
|
||||
{ AstLoop* const loopp = new AstLoop{$1, $2};
|
||||
$$ = loopp; }
|
||||
| yWHILE '(' expr ')' stmt
|
||||
{ AstLoop* const loopp = new AstLoop{$1};
|
||||
|
|
|
|||
Loading…
Reference in New Issue