Internals: Emit newlines for AstCStmt automatically. No functional change intended.

This commit is contained in:
Wilson Snyder
2025-09-26 08:25:47 -04:00
parent 62880c125e
commit 4ad1dde723
16 changed files with 841 additions and 820 deletions
+7 -4
View File
@@ -736,13 +736,16 @@ class TraceVisitor final : public VNVisitor {
cleanupFuncp->addInitsp(new AstCStmt{fl, EmitCUtil::symClassAssign()});
// Register it
m_regFuncp->addStmtsp(new AstText{fl, "tracep->addCleanupCb(", true});
m_regFuncp->addStmtsp(new AstAddrOfCFunc{fl, cleanupFuncp});
m_regFuncp->addStmtsp(new AstText{fl, ", vlSelf);\n", true});
{
AstNode* const argsp = new AstText{fl, "tracep->addCleanupCb(", true};
argsp->addNext(new AstAddrOfCFunc{fl, cleanupFuncp});
argsp->addNext(new AstText{fl, ", vlSelf);"});
m_regFuncp->addStmtsp(new AstCStmt{fl, argsp});
}
// Clear global activity flag
cleanupFuncp->addStmtsp(
new AstCStmt{m_topScopep->fileline(), "vlSymsp->__Vm_activity = false;\n"s});
new AstCStmt{m_topScopep->fileline(), "vlSymsp->__Vm_activity = false;"s});
// Clear fine grained activity flags
for (uint32_t i = 0; i < m_activityNumber; ++i) {