本文整理汇总了C++中Flow::nodeLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ Flow::nodeLabels方法的具体用法?C++ Flow::nodeLabels怎么用?C++ Flow::nodeLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flow
的用法示例。
在下文中一共展示了Flow::nodeLabels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reduceBlockBeginNodes
int CFAnalyzer::reduceBlockBeginNodes(Flow& flow) {
LabelSet labs=flow.nodeLabels();
int cnt=0;
for(LabelSet::iterator i=labs.begin();i!=labs.end();++i) {
if(isSgBasicBlock(getNode(*i))) {
cnt++;
Flow inFlow=flow.inEdges(*i);
Flow outFlow=flow.outEdges(*i);
// multiple out-edges not supported yet
assert(outFlow.size()<=1);
/* description of essential operations:
* inedges: (n_i,b)
* outedge: (b,n2)
* remove(n_i,b)
* remove(b,n2)
* insert(n1,n2)
*/
for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
Edge e1=*initer;
Edge e2=*outFlow.begin();
Edge newEdge=Edge(e1.source,e1.types(),e2.target);
flow.erase(e1);
flow.erase(e2);
flow.insert(newEdge);
}
}
}
return cnt;
}
示例2: reduceBlockEndNodes
int CFAnalysis::reduceBlockEndNodes(Flow& flow) {
LabelSet labs=flow.nodeLabels();
int cnt=0;
for(LabelSet::iterator i=labs.begin();i!=labs.end();++i) {
if(labeler->isBlockEndLabel(*i)) {
cnt+=reduceNode(flow,*i);
}
}
return cnt;
}
示例3: functionEntryLabels
LabelSet CFAnalysis::functionEntryLabels(Flow& flow) {
LabelSet resultSet;
LabelSet nodeLabels;
nodeLabels=flow.nodeLabels();
for(LabelSet::iterator i=nodeLabels.begin();i!=nodeLabels.end();++i) {
if(labeler->isFunctionEntryLabel(*i))
resultSet.insert(*i);
}
return resultSet;
}
示例4: reduceBlockBeginNodes
int CFAnalysis::reduceBlockBeginNodes(Flow& flow) {
LabelSet labs=flow.nodeLabels();
int cnt=0;
for(LabelSet::iterator i=labs.begin();i!=labs.end();++i) {
//cout<<"Checking label: "<<(*i)<<" node: "<<getNode(*i)<<" code:"<<getNode(*i)->unparseToString()<<endl;
if(isSgBasicBlock(getNode(*i))) {
#if 1
cnt+=reduceNode(flow,*i);
#else
cnt++;
Flow inFlow=flow.inEdges(*i);
Flow outFlow=flow.outEdges(*i);
// multiple out-edges not supported yet
assert(outFlow.size()<=1);
/* description of essential operations:
* inedges: (n_i,b)
* outedge: (b,n2)
* remove(n_i,b)
* remove(b,n2)
* insert(n1,n2)
*/
for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
Edge e1=*initer;
Edge e2=*outFlow.begin();
Edge newEdge=Edge(e1.source,e1.types(),e2.target);
flow.erase(e1);
flow.erase(e2);
flow.insert(newEdge);
}
#endif
}
}
return cnt;
}