Example #1
0
    // Autoflush
    virtual void visit(AstDisplay* nodep, AstNUser*) {
	startStatement(nodep);
	nodep->iterateChildren(*this);
	m_stmtp = NULL;
	if (v3Global.opt.autoflush()) {
	    AstNode* searchp = nodep->nextp();
	    while (searchp && searchp->castComment()) searchp = searchp->nextp();
	    if (searchp
		&& searchp->castDisplay()
		&& nodep->filep()->sameGateTree(searchp->castDisplay()->filep())) {
		// There's another display next; we can just wait to flush
	    } else {
		UINFO(4,"Autoflush "<<nodep<<endl);
		nodep->addNextHere(new AstFFlush(nodep->fileline(),
						 nodep->filep()->cloneTree(true)));
	    }
	}
    }