mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
astgen: generate type specific addNext, remove astNextNull
Generate type specific static overloads of Ast<Node>::addNext, which return the correct sub-type of the 'this' they were invoked on. Also remove AstNode::addNextNull, which is now only used in the parser, implement in verilog.y directly as a template function.
This commit is contained in:
+3
-3
@@ -139,14 +139,14 @@ private:
|
||||
UINFO(6,
|
||||
" at " << newfuncp->argTypes() << " und " << funcp->argTypes() << endl);
|
||||
funcp->declPrivate(true);
|
||||
AstNode* argsp = nullptr;
|
||||
AstVarRef* argsp = nullptr;
|
||||
for (AstNode* stmtp = newfuncp->argsp(); stmtp; stmtp = stmtp->nextp()) {
|
||||
if (AstVar* const portp = VN_CAST(stmtp, Var)) {
|
||||
if (portp->isIO() && !portp->isFuncReturn()) {
|
||||
AstNode* const newp = new AstVarRef(
|
||||
AstVarRef* const newp = new AstVarRef(
|
||||
portp->fileline(), portp,
|
||||
portp->isWritable() ? VAccess::WRITE : VAccess::READ);
|
||||
argsp = argsp ? argsp->addNextNull(newp) : newp;
|
||||
argsp = AstNode::addNext(argsp, newp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user