public void ClassificateEdges(ControlFlowGraph cfg) { DSTree = new DepthSpanningTree(cfg); foreach (var edge in cfg.Edges) { if (DSTree.Edges.Any(e => e.Target.Equals(edge.Target) && e.Source.Equals(edge.Source))) { EdgeTypes.Add(edge, EdgeType.Coming); } else if (FindBackwardPath(edge.Source, edge.Target)) { EdgeTypes.Add(edge, EdgeType.Retreating); } else { EdgeTypes.Add(edge, EdgeType.Cross); } } }
public DstEdgeClassifier(ControlFlowGraph cfg) { DSTree = new DepthSpanningTree(cfg); EdgeTypes = new Dictionary <Edge <ThreeAddressCode>, EdgeType>(); }
public ControlFlowGraph GetCFGWithSortedVertices() { var dst = new DepthSpanningTree(this); return(new ControlFlowGraph(SourceCode, dst.SortedBasicBlocks, dst.Vertices, Edges)); }