Remove some comments emitted in output.

* Comments were disabling some optimizations.
* Suspect rarely referred to.
* Sometimes incorrectly placed due to other optimizations.
This commit is contained in:
Wilson Snyder 2020-12-15 22:36:52 -05:00
parent 084ba6711b
commit c00c26c705
3 changed files with 6 additions and 14 deletions

View File

@ -283,7 +283,6 @@ private:
m_namer.scopep()->addActivep(m_scopeFinalp); m_namer.scopep()->addActivep(m_scopeFinalp);
} }
nodep->unlinkFrBack(); nodep->unlinkFrBack();
m_scopeFinalp->addStmtsp(new AstComment(nodep->fileline(), nodep->typeName(), true));
m_scopeFinalp->addStmtsp(nodep->bodysp()->unlinkFrBackWithNext()); m_scopeFinalp->addStmtsp(nodep->bodysp()->unlinkFrBackWithNext());
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->deleteTree(), nodep);
} }

View File

@ -294,31 +294,25 @@ private:
m_scopep = nullptr; m_scopep = nullptr;
} }
virtual void visit(AstNodeProcedure* nodep) override { virtual void visit(AstNodeProcedure* nodep) override {
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName(), true);
nodep->replaceWith(cmtp);
if (AstNode* stmtsp = nodep->bodysp()) { if (AstNode* stmtsp = nodep->bodysp()) {
stmtsp->unlinkFrBackWithNext(); stmtsp->unlinkFrBackWithNext();
cmtp->addNextHere(stmtsp); nodep->addNextHere(stmtsp);
} }
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
} }
virtual void visit(AstAlwaysPost* nodep) override { virtual void visit(AstAlwaysPost* nodep) override {
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName(), true);
nodep->replaceWith(cmtp);
if (AstNode* stmtsp = nodep->bodysp()) { if (AstNode* stmtsp = nodep->bodysp()) {
stmtsp->unlinkFrBackWithNext(); stmtsp->unlinkFrBackWithNext();
cmtp->addNextHere(stmtsp); nodep->addNextHere(stmtsp);
} }
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
} }
virtual void visit(AstAlwaysPostponed* nodep) override { virtual void visit(AstAlwaysPostponed* nodep) override {
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName(), true);
nodep->replaceWith(cmtp);
if (AstNode* stmtsp = nodep->bodysp()) { if (AstNode* stmtsp = nodep->bodysp()) {
stmtsp->unlinkFrBackWithNext(); stmtsp->unlinkFrBackWithNext();
cmtp->addNextHere(stmtsp); nodep->addNextHere(stmtsp);
} }
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
} }
virtual void visit(AstCoverToggle* nodep) override { virtual void visit(AstCoverToggle* nodep) override {
// nodep->dumpTree(cout, "ct:"); // nodep->dumpTree(cout, "ct:");

View File

@ -48,7 +48,6 @@ module Vt_debug_emitv;
???? // CFUNC '_final_TOP' ???? // CFUNC '_final_TOP'
$_CSTMT(Vt_debug_emitv* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; $_CSTMT(Vt_debug_emitv* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
); );
// FINAL
$display("stmt"); $display("stmt");
always @(posedge clk)@(negedge clk) begin always @(posedge clk)@(negedge clk) begin
$display("posedge clk"); $display("posedge clk");