本文整理汇总了C++中AstVarScope::user2方法的典型用法代码示例。如果您正苦于以下问题:C++ AstVarScope::user2方法的具体用法?C++ AstVarScope::user2怎么用?C++ AstVarScope::user2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstVarScope
的用法示例。
在下文中一共展示了AstVarScope::user2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
virtual void visit(AstNodeVarRef* nodep, AstNUser*) {
if (m_scopep) {
if (!m_logicVertexp) nodep->v3fatalSrc("Var ref not under a logic block\n");
AstVarScope* varscp = nodep->varScopep();
if (!varscp) nodep->v3fatalSrc("Var didn't get varscoped in V3Scope.cpp\n");
GateVarVertex* vvertexp = makeVarVertex(varscp);
UINFO(5," VARREF to "<<varscp<<endl);
if (m_inSenItem) vvertexp->setIsClock();
// For SYNCASYNCNET
if (m_inSenItem) varscp->user2(true);
else if (m_activep && m_activep->hasClocked() && !nodep->lvalue()) {
if (varscp->user2()) {
if (!vvertexp->rstSyncNodep()) vvertexp->rstSyncNodep(nodep);
} else {
if (!vvertexp->rstAsyncNodep()) vvertexp->rstAsyncNodep(nodep);
}
}
// We use weight of one; if we ref the var more than once, when we simplify,
// the weight will increase
if (nodep->lvalue()) {
new V3GraphEdge(&m_graph, m_logicVertexp, vvertexp, 1);
} else {
new V3GraphEdge(&m_graph, vvertexp, m_logicVertexp, 1);
}
}
}
示例2: 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);
}
}