mirror of
https://github.com/verilator/verilator.git
synced 2026-10-02 16:13:34 +02:00
Internals: Add AstLoop statement constructor. No functional change.
This commit is contained in:
+4
-2
@@ -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;
|
||||
|
||||
+2
-4
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user