private void AddCycle(List <CFGNode> cycle, List <Edge <CFGNode> > edges, HashSet <CFGNode> nodes) { CFGNode header = cycle[0]; List <CFGNode> bodyNodes = cycle.ToList(); List <Edge <CFGNode> > allEdgesInCycle = edges.Where(e => { return(nodes.Contains(e.Source)); }).ToList(); // Edges only for nodes into cycle List <Edge <CFGNode> > bodyEdgesInCycle = allEdgesInCycle.Where(e => { return(e.Target != header); }).ToList(); BodyRegion br = new BodyRegion(header, bodyNodes, bodyEdgesInCycle, NextName()); LoopRegion lr = new LoopRegion(header, bodyNodes, allEdgesInCycle, br, NextName()); regions.Add(br); regions.Add(lr); }
public LoopRegion(CFGNode header, List <CFGNode> nodes, List <Edge <CFGNode> > edges, BodyRegion body, string name = "loopR") : base(header, nodes, edges, name) { bodyReg = body; }