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


C++ Flow::insert方法代码示例

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


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

示例1: WhileAndDoWhileLoopFlow

Flow CFAnalysis::WhileAndDoWhileLoopFlow(SgNode* node, 
                                         Flow edgeSet,
                                         EdgeType edgeTypeParam1,
                                         EdgeType edgeTypeParam2) {
  if(!(isSgWhileStmt(node) || isSgDoWhileStmt(node))) {
    throw SPRAY::Exception("Error: WhileAndDoWhileLoopFlow: unsupported loop construct.");
  }
  SgNode* condNode=SgNodeHelper::getCond(node);
  Label condLabel=getLabel(condNode);
  SgNode* bodyNode=SgNodeHelper::getLoopBody(node);
  assert(bodyNode);
  Edge edge=Edge(condLabel,EDGE_TRUE,initialLabel(bodyNode));
  edge.addType(edgeTypeParam1);
  Flow flowB=flow(bodyNode);
  LabelSet finalSetB=finalLabels(bodyNode);
  edgeSet+=flowB;
  edgeSet.insert(edge);
  // back edges in while (forward edges in do-while)
  for(LabelSet::iterator i=finalSetB.begin();i!=finalSetB.end();++i) {
    Edge e;
    if(SgNodeHelper::isCond(labeler->getNode(*i))) {
      e=Edge(*i,EDGE_FALSE,condLabel);
      e.addType(edgeTypeParam2);
    } else {
      e=Edge(*i,edgeTypeParam2,condLabel);
    }
    edgeSet.insert(e);
  }
  return edgeSet;
}
开发者ID:billhoffman,项目名称:rose-develop,代码行数:30,代码来源:CFAnalysis.C

示例2: intraInterFlow

void CFAnalyzer::intraInterFlow(Flow& flow, InterFlow& interFlow) {
  for(InterFlow::iterator i=interFlow.begin();i!=interFlow.end();++i) {
	if((*i).entry==Labeler::NO_LABEL && (*i).exit==Labeler::NO_LABEL) {
	  Edge externalEdge=Edge((*i).call,EDGE_EXTERNAL,(*i).callReturn);	  
	  flow.insert(externalEdge);
	} else {
	  Edge callEdge=Edge((*i).call,EDGE_CALL,(*i).entry);
	  Edge callReturnEdge=Edge((*i).exit,EDGE_CALLRETURN,(*i).callReturn);
	  Edge localEdge=Edge((*i).call,EDGE_LOCAL,(*i).callReturn);
	  flow.insert(callEdge);
	  flow.insert(callReturnEdge);
	  flow.insert(localEdge);
	}
  }
}
开发者ID:adrian-prantl,项目名称:rose,代码行数:15,代码来源:CFAnalyzer.C

示例3:

Flow Flow::operator+(Flow& s2) {
  Flow result;
  result=*this;
  for(Flow::iterator i2=s2.begin();i2!=s2.end();++i2)
    result.insert(*i2);
  return result;
}
开发者ID:8l,项目名称:rose,代码行数:7,代码来源:Flow.C

示例4: reverseFlow

SPRAY::Flow Flow::reverseFlow() {
  Flow reverseFlow;
  for(Flow::iterator i=begin();i!=end();++i) {
    reverseFlow.insert(Edge((*i).target,(*i).getTypes(),(*i).source));
  }
  return reverseFlow;
}
开发者ID:8l,项目名称:rose,代码行数:7,代码来源:Flow.C

示例5: 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;
}
开发者ID:billhoffman,项目名称:rose-develop,代码行数:30,代码来源:CFAnalysis.C

示例6: 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;
}
开发者ID:adrian-prantl,项目名称:rose,代码行数:31,代码来源:CFAnalyzer.C

示例7: reduceNode

int CFAnalysis::reduceNode(Flow& flow, Label lab) {
  Flow inFlow=flow.inEdges(lab);
  Flow outFlow=flow.outEdges(lab);
  /* description of essential operations:
   *   inedges: (n_i,b)
   *   outedge: (b,n2) 
   *   remove(n_i,b)
   *   remove(b,n2)
   *   insert(n1,n2)
   */
  if(inFlow.size()==0 && outFlow.size()==0)
    return 0;

  if(inFlow.size()==0 || outFlow.size()==0) {
    Flow edges=inFlow+outFlow;
    flow.deleteEdges(edges);
    return 1;
  }

  for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
    for(Flow::iterator outiter=outFlow.begin();outiter!=outFlow.end();++outiter) {
      Edge e1=*initer;
      Edge e2=*outiter;
      Edge newEdge=Edge(e1.source,e1.types(),e2.target);
      flow.erase(e1);
      flow.erase(e2);
      flow.insert(newEdge);
    }
  }
  return 1;
}
开发者ID:InstRO,项目名称:InstRO-ROSE-edg4x,代码行数:31,代码来源:CFAnalysis.C

示例8: edgesOfType

Flow Flow::edgesOfType(EdgeType edgeType) {
  Flow flow;
  for(Flow::iterator i=begin();i!=end();++i) {
    if((*i).isType(edgeType))
      flow.insert(*i);
  }
  flow.setDotOptionDisplayLabel(_dotOptionDisplayLabel);
  flow.setDotOptionDisplayStmt(_dotOptionDisplayStmt);
  return flow;
}
开发者ID:8l,项目名称:rose,代码行数:10,代码来源:Flow.C

示例9: inEdges

Flow Flow::inEdges(Label label) {
  Flow flow;
  for(Flow::iterator i=begin();i!=end();++i) {
    if((*i).target==label)
      flow.insert(*i);
  }
  flow.setDotOptionDisplayLabel(_dotOptionDisplayLabel);
  flow.setDotOptionDisplayStmt(_dotOptionDisplayStmt);
  return flow;
}
开发者ID:8l,项目名称:rose,代码行数:10,代码来源:Flow.C

示例10: outEdges

Flow Flow::outEdges(Label label) {
  Flow flow;
  if(!_boostified) {
    for(Flow::iterator i=begin();i!=end();++i) {
      if((*i).source==label)
        flow.insert(*i);
    }
  } else {
    typedef graph_traits<FlowGraph> GraphTraits;
    //    typename property_map<FlowGraph, vertex_index_t>::type 
    // index = get(vertex_index, _flowGraph);
    GraphTraits::out_edge_iterator out_i, out_end;
    GraphTraits::edge_descriptor e;
    for (tie(out_i, out_end) = out_edges(label.getId(), _flowGraph); 
         out_i != out_end; ++out_i) {
      e = *out_i;
      Label src = source(e, _flowGraph), targ = target(e, _flowGraph);
      flow.insert(Edge(src,_flowGraph[e],targ));
    }
  }
  flow.setDotOptionDisplayLabel(_dotOptionDisplayLabel);
  flow.setDotOptionDisplayStmt(_dotOptionDisplayStmt);
  return flow;
}
开发者ID:8l,项目名称:rose,代码行数:24,代码来源:Flow.C

示例11: toFlowEnumerateStates

Flow* ParProTransitionGraph::toFlowEnumerateStates(NumberGenerator& numGen) {
  Flow* result = new Flow();
  unordered_map<const ParProEState*, Label> eState2Label;
  for (EStateTransitionMap::iterator i=_outEdges.begin(); i!=_outEdges.end(); i++) {
    for (ParProTransitions::iterator k=i->second.begin(); k!=i->second.end(); k++) {
      const ParProEState* source = (*k).source;
      if (eState2Label.find(source) == eState2Label.end()) {
	eState2Label[source] = Label(numGen.next());
      }
      const ParProEState* target = (*k).target;
      if (eState2Label.find(target) == eState2Label.end()) {
	eState2Label[target] = Label(numGen.next());
      }
      Edge e(eState2Label[source], eState2Label[target]);
      e.setAnnotation(k->edge.getAnnotation());
      result->insert(e);
    }
  }
  return result;
}
开发者ID:matzke1,项目名称:rose-develop,代码行数:20,代码来源:ParProTransitionGraph.C

示例12: 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;
}
开发者ID:InstRO,项目名称:InstRO-ROSE-edg4x,代码行数:36,代码来源:CFAnalysis.C

示例13: flow

Flow CFAnalysis::flow(SgNode* node) {
  assert(node);

  Flow edgeSet;
  if(node==0)
    return edgeSet;
  if(isSgFunctionDeclaration(node)) {
    return edgeSet;
  }

  if(isSgProject(node)||isSgFileList(node)||isSgGlobal(node)||isSgSourceFile(node)) {
    RoseAst ast(node);
    Flow tmpEdgeSet;
    // search for all functions and union flow for all functions
    for(RoseAst::iterator i=ast.begin();i!=ast.end();++i) {
      // schroder3 (2016-07-29): Added " && !isSgTemplateFunctionDefinition(*i)" to prevent
      //  SgTemplateFunctionDefinition nodes from being added to the ICFG. SgTemplateFunctionDefinitions
      //  are never called because they are only used in template declarations (SgTemplateDeclaration)
      //  (and not in template instantiation or specialization declarations (SgTemplateInstantiationFunctionDecl)).
      //  Template instantiation/ specialization declarations have "normal" SgFunctionDefinition nodes as
      //  corresponding definition. Even in case of an implicit instantiation of an implicit specialization ROSE
      //  creates a SgTemplateInstantiationFunctionDecl and copies the body of the SgTemplateFunctionDefinition
      //  to a new SgFunctionDefinition and uses the SgFunctionDefinition as definition.
      if(isSgFunctionDefinition(*i) && !isSgTemplateFunctionDefinition(*i)) {
        // schroder3 (2016-07-12): We can not skip the children of a function definition
        //  because there might be a member function definition inside the function definition.
        //  Example:
        //   int main() {
        //     class A {
        //      public:
        //       void mf() {
        //         int i = 2;
        //       }
        //     };
        //   }
        //
        // i.skipChildrenOnForward();

        //cout << "STATUS: Generating flow for function "<<SgNodeHelper::getFunctionName(*i)<<endl;
        tmpEdgeSet=flow(*i);
        edgeSet+=tmpEdgeSet;
      }
    }
    return edgeSet;
  }
  
  // special case of function call pattern
  if(SgNodeHelper::Pattern::matchFunctionCall(node)) {
    // we add the 'local' edge when intraInter flow is computed (it may also be an 'external' edge)
#if 0
    Label callLabel=labeler->functionCallLabel(node);
    Label callReturnLabel=labeler->functionCallReturnLabel(node);
    edgeSet.insert(Edge(callLabel,EDGE_LOCAL,callReturnLabel));
#endif
    // add special case edge for callReturn to returnNode SgReturnStmt(SgFunctionCallExp) 
    // edge: SgFunctionCallExp.callReturn->init(SgReturnStmt)
    if(SgNodeHelper::Pattern::matchReturnStmtFunctionCallExp(node)) {
      Label callReturnLabel=labeler->functionCallReturnLabel(node);
      Label returnStmtLabel=labeler->functionCallReturnLabel(node)+1;
      edgeSet.insert(Edge(callReturnLabel,EDGE_FORWARD,returnStmtLabel));
    }
    return edgeSet;
  }

  switch (node->variantT()) {
  case V_SgFunctionDefinition: {
    SgBasicBlock* body=isSgFunctionDefinition(node)->get_body();
    Edge edge=Edge(labeler->functionEntryLabel(node),EDGE_FORWARD,initialLabel(body));
    edgeSet.insert(edge);
    Flow bodyFlow=flow(body);
    edgeSet+=bodyFlow;
    /* add explicitly edge from last stmt of function to exit-node
       not that a return at the end of a function is *not* represented in a ROSE AST.
       if return does not exist, we need to add an explicit edge from end of function to exit
       since we create this edge with the computed final node a branch with returns in all branches is
       maintained properly.
       this edge is identical if we have some other branches. Because we maintain the edges as an edge-set
       this operation is always OK.
     */
#if 0
    LabelSet funFinalLabels=finalLabels(node);
#else
    LabelSet funFinalLabels=finalLabels(body);
#endif
    for(LabelSet::iterator i=funFinalLabels.begin();i!=funFinalLabels.end();++i) {
      Edge explicitEdge=Edge(*i,EDGE_FORWARD,labeler->functionExitLabel(node));
      if(SgNodeHelper::isLoopCond(labeler->getNode(*i))) {
        explicitEdge.addType(EDGE_FALSE);
      }
      if(SgNodeHelper::isCond(labeler->getNode(*i))) {
        if(SgIfStmt* ifStmt=isSgIfStmt(labeler->getNode(*i)->get_parent())) {
          if(!SgNodeHelper::getFalseBranch(ifStmt)) {
            // MS: 07/02/2014: in case of empty if-false branch (at end of function), FALSE must be added to explicit node (only if-false can be empty)
            explicitEdge.addType(EDGE_FALSE);
          }
        }
      }
      edgeSet.insert(explicitEdge);
    }
    return edgeSet;
//.........这里部分代码省略.........
开发者ID:billhoffman,项目名称:rose-develop,代码行数:101,代码来源:CFAnalysis.C

示例14: reduceNode

int CFAnalysis::reduceNode(Flow& flow, Label lab) {
  Flow inFlow=flow.inEdges(lab);
  Flow outFlow=flow.outEdges(lab);
  // edge type cleanup
  // if true and false edge exist, remove both (merging true and false branches to a single branch)
  // if forward and backward exist, remove forward (we are not removing the cycle)
  
  /* description of essential operations:
   *   inedges: (n_i,b)
   *   outedge: (b,n2) 
   *   remove(n_i,b)
   *   remove(b,n2)
   *   insert(n1,n2)
   */
  if(inFlow.size()==0 && outFlow.size()==0) {
    return 0;
  } else if(inFlow.size()>0 && outFlow.size()>0) {
    set<Edge> toErase;
    set<Edge> toInsert;
    for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
      for(Flow::iterator outiter=outFlow.begin();outiter!=outFlow.end();++outiter) {
        Edge e1=*initer;
        Edge e2=*outiter;
        // preserve edge annotations of ingoing and outgoing edges
        EdgeTypeSet unionEdgeTypeSet;
        EdgeTypeSet edgeTypeSet1=(*initer).types();
        unionEdgeTypeSet.insert(edgeTypeSet1.begin(),edgeTypeSet1.end());
        EdgeTypeSet edgeTypeSet2=(*outiter).types();
        // only copy an edge annotation in the outgoing edge if it is
        // not a true-annotation or a false-annotation
        for(EdgeTypeSet::iterator i=edgeTypeSet2.begin();i!=edgeTypeSet2.end();++i) {
          if(*i!=EDGE_TRUE && *i!=EDGE_FALSE) {
            unionEdgeTypeSet.insert(*i);
          }
        }
        if(unionEdgeTypeSet.find(EDGE_TRUE)!=unionEdgeTypeSet.end()
           && unionEdgeTypeSet.find(EDGE_FALSE)!=unionEdgeTypeSet.end()) {
          unionEdgeTypeSet.erase(EDGE_TRUE);
          unionEdgeTypeSet.erase(EDGE_FALSE);
        }
        if(unionEdgeTypeSet.find(EDGE_FORWARD)!=unionEdgeTypeSet.end()
           && unionEdgeTypeSet.find(EDGE_BACKWARD)!=unionEdgeTypeSet.end()) {
          unionEdgeTypeSet.erase(EDGE_FORWARD);
          // keep backward edge annotation
        }
        
        Edge newEdge=Edge(e1.source(),unionEdgeTypeSet,e2.target());
        toErase.insert(e1);
        toErase.insert(e2);
        if(e1.source()!=e2.target()) {
          toInsert.insert(newEdge);
        }
      }
    }
    for(set<Edge>::iterator i=toErase.begin();i!=toErase.end();++i) {
      flow.erase(*i);
    }
    for(set<Edge>::iterator i=toInsert.begin();i!=toInsert.end();++i) {
      flow.insert(*i);
    }
    return 1;
  } else if(inFlow.size()>0) {
    for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
      Edge e1=*initer;
      flow.erase(e1);
    }
    return 1;
  } else if(outFlow.size()>0) {
    for(Flow::iterator outiter=outFlow.begin();outiter!=outFlow.end();++outiter) {
      Edge e2=*outiter;
      flow.erase(e2);
    }
    return 1;
  }
  return 0;
}
开发者ID:billhoffman,项目名称:rose-develop,代码行数:76,代码来源:CFAnalysis.C

示例15: flow

Flow CFAnalyzer::flow(SgNode* node) {
  assert(node);

  Flow edgeSet;
  if(node==0)
	return edgeSet;
  if(isSgFunctionDeclaration(node)) {
	return edgeSet;
  }

  if(isSgProject(node)||isSgFileList(node)||isSgGlobal(node)||isSgSourceFile(node)) {
	RoseAst ast(node);
	Flow tmpEdgeSet;
	// search for all functions and union flow for all functions
	for(RoseAst::iterator i=ast.begin();i!=ast.end();++i) {
	  if(isSgFunctionDefinition(*i)) {
		i.skipChildrenOnForward();
		cout << "STATUS: Generating flow for function "<<SgNodeHelper::getFunctionName(*i)<<endl;
		tmpEdgeSet=flow(*i);
		edgeSet+=tmpEdgeSet;
	  }
	}
	return edgeSet;
  }
  
  // special case of function call pattern
  if(SgNodeHelper::Pattern::matchFunctionCall(node)) {
	// we add the 'local' edge when intraInter flow is computed (it may also be an 'external' edge)
#if 0
	Label callLabel=labeler->functionCallLabel(node);
	Label callReturnLabel=labeler->functionCallReturnLabel(node);
	edgeSet.insert(Edge(callLabel,EDGE_LOCAL,callReturnLabel));
#endif
	// add special case edge for callReturn to returnNode SgReturnStmt(SgFunctionCallExp) 
	// edge: SgFunctionCallExp.callReturn->init(SgReturnStmt)
	if(SgNodeHelper::Pattern::matchReturnStmtFunctionCallExp(node)) {
	  Label callReturnLabel=labeler->functionCallReturnLabel(node);
	  Label returnStmtLabel=labeler->functionCallReturnLabel(node)+1;
	  edgeSet.insert(Edge(callReturnLabel,EDGE_FORWARD,returnStmtLabel));
	}
	return edgeSet;
  }

  switch (node->variantT()) {
  case V_SgFunctionDefinition: {
	SgBasicBlock* body=isSgFunctionDefinition(node)->get_body();
	Edge edge=Edge(labeler->functionEntryLabel(node),EDGE_FORWARD,initialLabel(body));
	edgeSet.insert(edge);
	Flow bodyFlow=flow(body);
	edgeSet+=bodyFlow;
	/* add explicitly edge from last stmt of function to exit-node
	   not that a return at the end of a function is *not* represented in a ROSE AST.
	   if return does not exist, we need to add an explicit edge from end of function to exit
	   since we create this edge with the computed final node a branch with returns in all branches is
	   maintained properly.
	   this edge is identical if we have some other branches. Because we maintain the edges as an edge-set
	   this operation is always OK.
	 */
	LabelSet funFinalLabels=finalLabels(node);
	for(LabelSet::iterator i=funFinalLabels.begin();i!=funFinalLabels.end();++i) {
	  Edge explicitEdge=Edge(*i,EDGE_FORWARD,labeler->functionExitLabel(node));
	  if(SgNodeHelper::isLoopCond(labeler->getNode(*i))) {
		explicitEdge.addType(EDGE_FALSE);
	  }
	  edgeSet.insert(explicitEdge);
	}
	return edgeSet;
  }
  case V_SgReturnStmt: {
	SgNode* funcDef=SgNodeHelper::correspondingSgFunctionDefinition(node);
	if(!funcDef)
	  cerr << "Error: No corresponding function for ReturnStmt found."<<endl;
	assert(isSgFunctionDefinition(funcDef));
	Edge edge=Edge(getLabel(node),EDGE_FORWARD,labeler->functionExitLabel(funcDef));
	edgeSet.insert(edge);
	return edgeSet;
  }
  case V_SgBreakStmt:
  case V_SgInitializedName:
  case V_SgVariableDeclaration:
  case V_SgNullStatement:
  case V_SgLabelStatement:
  case V_SgExprStatement:
	return edgeSet;
  case V_SgIfStmt: {
	SgNode* nodeC=SgNodeHelper::getCond(node);
	Label condLabel=getLabel(nodeC);
	SgNode* nodeTB=SgNodeHelper::getTrueBranch(node);
	Edge edgeTB=Edge(condLabel,EDGE_TRUE,initialLabel(nodeTB));
	edgeTB.addType(EDGE_FORWARD);
	edgeSet.insert(edgeTB);
	Flow flowTB=flow(nodeTB);
	edgeSet+=flowTB;
	if(SgNode* nodeFB=SgNodeHelper::getFalseBranch(node)) {
	  Flow flowFB=flow(nodeFB);
	  Edge edgeFB=Edge(condLabel,EDGE_FALSE,initialLabel(nodeFB));
	  edgeFB.addType(EDGE_FORWARD);
	  edgeSet.insert(edgeFB);
	  edgeSet+=flowFB;
	}
//.........这里部分代码省略.........
开发者ID:adrian-prantl,项目名称:rose,代码行数:101,代码来源:CFAnalyzer.C


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