Generate AstNode accessors via astgen

Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
This commit is contained in:
Geza Lore
2022-09-21 14:05:27 +01:00
parent 72e7271a14
commit 95145038b4
74 changed files with 1427 additions and 1579 deletions
+3 -3
View File
@@ -3072,7 +3072,7 @@ static void addMTaskToFunction(const ThreadSchedule& schedule, const uint32_t th
AstVar* const varp = new AstVar(fl, VVarType::MODULETEMP, name, mtaskStateDtypep);
varp->valuep(new AstConst(fl, nDependencies));
varp->protect(false); // Do not protect as we still have references in AstText
modp->addStmtp(varp);
modp->addStmtsp(varp);
// For now, reference is still via text bashing
addStrStmt("vlSelf->" + name + +".waitUntilUpstreamDone(even_cycle);\n");
}
@@ -3133,7 +3133,7 @@ static const std::vector<AstCFunc*> createThreadFunctions(const ThreadSchedule&
const uint32_t threadId = schedule.threadId(thread.front());
const string name{"__Vthread__" + tag + "__" + cvtToStr(threadId)};
AstCFunc* const funcp = new AstCFunc(fl, name, nullptr, "void");
modp->addStmtp(funcp);
modp->addStmtsp(funcp);
funcps.push_back(funcp);
funcp->isStatic(true); // Uses void self pointer, so static and hand rolled
funcp->isLoose(true);
@@ -3161,7 +3161,7 @@ static const std::vector<AstCFunc*> createThreadFunctions(const ThreadSchedule&
= new AstVar{fl, VVarType::MODULETEMP, "__Vm_mtaskstate_final__" + tag, mtaskStateDtypep};
varp->valuep(new AstConst(fl, funcps.size()));
varp->protect(false); // Do not protect as we still have references in AstText
modp->addStmtp(varp);
modp->addStmtsp(varp);
return funcps;
}