本文整理汇总了C++中LabelSet::end方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelSet::end方法的具体用法?C++ LabelSet::end怎么用?C++ LabelSet::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelSet
的用法示例。
在下文中一共展示了LabelSet::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
LabelSet LabelSet::operator+(LabelSet& s2) {
LabelSet result;
result=*this;
for(LabelSet::iterator i2=s2.begin();i2!=s2.end();++i2)
result.insert(*i2);
return result;
}
示例2: controlDependenceGraph
Flow CFAnalysis::controlDependenceGraph(Flow& controlFlow) {
LabelSet condLabels=conditionLabels(controlFlow);
LabelSet targetLabels;
Flow controlDependenceEdges;
for(LabelSet::iterator i=condLabels.begin();i!=condLabels.end();++i) {
SgNode* condition=getLabeler()->getNode(*i);
cerr<<"DEBUG: cond:"<<condition->class_name()<<endl;
SgNode* stmt=SgNodeHelper::getParent(condition);
cerr<<"DEBUG: stmt:"<<stmt->class_name()<<endl;
// while/dowhile/for
if(SgNodeHelper::isLoopCond(condition)) {
SgNode* loopBody=SgNodeHelper::getLoopBody(stmt);
cerr<<"DEBUG: loopBody:"<<loopBody->class_name()<<endl;
LabelSet loopBodyInitLabels=setOfInitialLabelsOfStmtsInBlock(loopBody);
targetLabels=loopBodyInitLabels;
}
// if
if(isSgIfStmt(stmt)) {
SgNode* trueBranch=SgNodeHelper::getTrueBranch(stmt);
LabelSet trueBranchInitLabels=setOfInitialLabelsOfStmtsInBlock(trueBranch);
SgNode* falseBranch=SgNodeHelper::getFalseBranch(stmt);
LabelSet falseBranchInitLabels=setOfInitialLabelsOfStmtsInBlock(falseBranch);
targetLabels=trueBranchInitLabels+falseBranchInitLabels;
}
for(LabelSet::iterator j=targetLabels.begin();j!=targetLabels.end();++j) {
controlDependenceEdges.insert(Edge(*i,EDGE_FORWARD,*j));
}
}
return controlDependenceEdges;
}
示例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: reachableNodesButNotBeyondTargetNode
// MS: will possibly be replaced with an implementation from the BOOST graph library
LabelSet Flow::reachableNodesButNotBeyondTargetNode(Label start, Label target) {
LabelSet reachableNodes;
LabelSet toVisitSet=succ(start);
size_t oldSize=0;
size_t newSize=0;
do {
LabelSet newToVisitSet;
for(LabelSet::iterator i=toVisitSet.begin();i!=toVisitSet.end();++i) {
LabelSet succSet=succ(*i);
for(LabelSet::iterator j=succSet.begin();j!=succSet.end();++j) {
if(reachableNodes.find(*j)==reachableNodes.end())
newToVisitSet.insert(*j);
}
}
toVisitSet=newToVisitSet;
oldSize=reachableNodes.size();
reachableNodes+=toVisitSet;
newSize=reachableNodes.size();
} while(oldSize!=newSize);
return reachableNodes;
}