本文整理汇总了C++中Flow::succ方法的典型用法代码示例。如果您正苦于以下问题:C++ Flow::succ方法的具体用法?C++ Flow::succ怎么用?C++ Flow::succ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flow
的用法示例。
在下文中一共展示了Flow::succ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inlineTrivialFunctions
/*!
* \author Markus Schordan
* \date 2013.
*/
int CFAnalysis::inlineTrivialFunctions(Flow& flow) {
//cerr<<"Error: inlineTrivialFunctions is deactivated."<<endl;
//exit(1);
// 1) compute all functions that are called exactly once (i.e. number of pred in ICFG is 1)
// AND have the number of formal parameters is 0 AND have void return type.
// 2) inline function
// more advanced version will also clone function-CFGs, but this makes the mapping label<->code loose the 1-1 mapping property.
int numInlined=0;
LabelSet lnLabs=functionEntryLabels(flow);
for(LabelSet::iterator i=lnLabs.begin();i!=lnLabs.end();++i) {
LabelSet pred=flow.pred(*i);
if(pred.size()==1) {
Label lc=*pred.begin();
ROSE_ASSERT(getLabeler()->isFunctionCallLabel(lc));
// check the number of formal parameters of ln
if(numberOfFunctionParameters(*i)==0 && isVoidFunction(*i)) {
// reduce all four nodes: lc,ln,lx,lr (this also reduces a possibly existing local edge)
Label ln=*i;
Label lx=correspondingFunctionExitLabel(ln);
LabelSet succ=flow.succ(lx);
// since we have exactly one call there must be exactly one return edge
ROSE_ASSERT(succ.size()==1);
Label lr=*succ.begin();
// reduce all four nodes now
reduceNode(flow,lc);
reduceNode(flow,ln);
reduceNode(flow,lx);
reduceNode(flow,lr);
numInlined++;
}
}
}
return numInlined;
}
示例2: reduceEmptyConditionNodes
int CFAnalysis::reduceEmptyConditionNodes(Flow& flow) {
LabelSet labs=conditionLabels(flow);
int cnt=0;
for(LabelSet::iterator i=labs.begin();i!=labs.end();++i) {
if(flow.succ(*i).size()==1) {
cnt+=reduceNode(flow,*i);
}
}
return cnt;
}