Internals: Create FuncRef/TaskRef directly from Func/Task pointer. No functional change intended

This commit is contained in:
Wilson Snyder
2024-12-15 09:15:49 -05:00
parent 6aa7123a8c
commit 4b4ca90c71
6 changed files with 38 additions and 45 deletions
+2 -5
View File
@@ -1849,16 +1849,13 @@ AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newn
newFVarp->name(newTaskp->name());
newTaskp->fvarp(newFVarp);
newTaskp->dtypeFrom(newFVarp);
newCallp = new AstFuncRef{taskp->fileline(), taskp->name(), nullptr};
newCallp->taskp(taskp);
newCallp->dtypeFrom(newFVarp);
newCallp = new AstFuncRef{taskp->fileline(), VN_AS(taskp, Func), nullptr};
newCallInsertp
= new AstAssign{taskp->fileline(),
new AstVarRef{fvarp->fileline(), newFVarp, VAccess::WRITE}, newCallp};
newCallInsertp->dtypeFrom(newFVarp);
} else if (VN_IS(taskp, Task)) {
newCallp = new AstTaskRef{taskp->fileline(), taskp->name(), nullptr};
newCallp->taskp(taskp);
newCallp = new AstTaskRef{taskp->fileline(), VN_AS(taskp, Task), nullptr};
newCallInsertp = new AstStmtExpr{taskp->fileline(), newCallp};
} else {
taskp->v3fatalSrc("Unsupported: Non-constant default value in missing argument in a "