当前位置: 首页>>代码示例>>C++>>正文


C++ AstVarScope::user1方法代码示例

本文整理汇总了C++中AstVarScope::user1方法的典型用法代码示例。如果您正苦于以下问题:C++ AstVarScope::user1方法的具体用法?C++ AstVarScope::user1怎么用?C++ AstVarScope::user1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AstVarScope的用法示例。


在下文中一共展示了AstVarScope::user1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: visit

    virtual void visit(AstVarRef* nodep, AstNUser*) {
	// Consumption/generation of a variable,
	AstVarScope* vscp = nodep->varScopep();
	if (!vscp) nodep->v3fatalSrc("Scope not assigned");
	m_sequence++;
	if (nodep->lvalue()) {
	    // First generator
	    if (!vscp->user1()) vscp->user1(m_sequence);
	} else {
	    // Last consumer
	    vscp->user2(m_sequence);
	}
    }
开发者ID:toddstrader,项目名称:verilator-integer-array,代码行数:13,代码来源:V3LifePost.cpp

示例2: visit

    virtual void visit(AstVarRef* nodep) {
	// Consumption/generation of a variable,
	AstVarScope* vscp = nodep->varScopep();
	if (!vscp) nodep->v3fatalSrc("Scope not assigned");
	if (m_activep) {
	    UINFO(8,"  VarAct "<<nodep<<endl);
	    vscp->user1(true);
	}
	if (m_assignp && nodep->lvalue() && vscp->user1()) {
	    // Variable was previously used as a clock, and is now being set
	    // Thus a unordered generated clock...
	    UINFO(8,"  VarSetAct "<<nodep<<endl);
	    vscp->circular(true);
	}
    }
开发者ID:jeras,项目名称:verilator,代码行数:15,代码来源:V3GenClk.cpp

示例3: deadCheckVar

    void deadCheckVar() {
	// Delete any unused varscopes
	for (vector<AstVarScope*>::iterator it = m_vscsp.begin(); it!=m_vscsp.end(); ++it) {
	    AstVarScope* vscp = *it;
	    if (vscp->user1() == 0) {
		UINFO(4,"  Dead "<<vscp<<endl);
		pair <AssignMap::iterator,AssignMap::iterator> eqrange = m_assignMap.equal_range(vscp);
		for (AssignMap::iterator it = eqrange.first; it != eqrange.second; ++it) {
		    AstNodeAssign* assp = it->second;
		    UINFO(4,"    Dead assign "<<assp<<endl);
		    assp->unlinkFrBack()->deleteTree(); VL_DANGLING(assp);
		}
		vscp->unlinkFrBack()->deleteTree(); VL_DANGLING(vscp);
	    }
	}
	for (vector<AstNode*>::iterator it = m_varEtcsp.begin(); it!=m_varEtcsp.end(); ++it) {
	    if ((*it)->user1() == 0) {
		UINFO(4,"  Dead "<<(*it)<<endl);
		(*it)->unlinkFrBack()->deleteTree(); (*it)=NULL;
	    }
	}
    }
开发者ID:RCSL-HKUST,项目名称:heterosim,代码行数:22,代码来源:V3Dead.cpp

示例4: dualBranch

    void dualBranch(LifeBlock* life1p, LifeBlock* life2p) {
	// Find any common sets on both branches of IF and propagate upwards
	//life1p->lifeDump();
	//life2p->lifeDump();
	AstNode::user1ClearTree();	// user1p() used on entire tree
	for (LifeMap::iterator it = life1p->m_map.begin(); it!=life1p->m_map.end(); ++it) {
	    // When the if branch sets a var before it's used, mark that variable
	    if (it->second.setBeforeUse()) it->first->user1(1);
	}
	for (LifeMap::iterator it = life2p->m_map.begin(); it!=life2p->m_map.end(); ++it) {
	    // When the else branch sets a var before it's used
	    AstVarScope* nodep = it->first;
	    if (it->second.setBeforeUse() && nodep->user1()) {
		// Both branches set the var, we can remove the assignment before the IF.
		UINFO(4,"DUALBRANCH "<<nodep<<endl);
		LifeMap::iterator itab = m_map.find(nodep);
		if (itab != m_map.end()) {
		    checkRemoveAssign(itab);
		}
	    }
	}
	//this->lifeDump();
    }
开发者ID:jeras,项目名称:verilator,代码行数:23,代码来源:V3Life.cpp


注:本文中的AstVarScope::user1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。