mirror of
https://github.com/verilator/verilator.git
synced 2026-09-07 10:01:11 +02:00
Internals: Refactor generate construct Ast handling (#6280) We introduce AstNodeGen, the common base class of AstGenBlock, AstGenCase, AstGenFor, and AstGenIf, which together represent all SV generate constructs. Subsequently remove AstNodeFor, AstNodeCase (AstCase is now directly derived from AstNodeStmt) and adjust internals to work on the new representation. Output is identical modulo hashes do to changed AstNode type ids, no functional change intended. Step towards #6280.
This commit is contained in:
+2
-2
@@ -194,7 +194,7 @@ struct SplitVarImpl VL_NOT_FINAL {
|
||||
stmtp->unlinkFrBack();
|
||||
// Insert begin-end because temp value may be inserted to this block later.
|
||||
const std::string name = "__VsplitVarBlk" + cvtToStr(modp->user1Inc(1));
|
||||
ap->addStmtsp(new AstBegin{ap->fileline(), name, stmtp, false, false});
|
||||
ap->addStmtsp(new AstBegin{ap->fileline(), name, stmtp, false});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ struct SplitVarImpl VL_NOT_FINAL {
|
||||
// Insert begin-end because temp value may be inserted to this block later.
|
||||
FileLine* const fl = initp->fileline();
|
||||
const std::string name = "__VsplitVarBlk" + cvtToStr(modp->user1Inc(1));
|
||||
initp->replaceWith(new AstInitial{fl, new AstBegin{fl, name, stmtp, false, false}});
|
||||
initp->replaceWith(new AstInitial{fl, new AstBegin{fl, name, stmtp, false}});
|
||||
VL_DO_DANGLING(initp->deleteTree(), initp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user