コード例 #1
0
        public DominatorGraph <StructureNode> AnalyzeGraph()
        {
            var graph         = new StructureGraphAdapter(curProc.Nodes);
            var reverseGraph  = new ReverseGraph(curProc.Nodes);
            var infiniteLoops = FindInfiniteLoops(graph, curProc.EntryNode);

            AddPseudoEdgeFromInfiniteLoopsToExitNode(graph, infiniteLoops, curProc.ExitNode, reverseGraph);

            var pdg = new DominatorGraph <StructureNode>(reverseGraph, curProc.ExitNode);

            SetImmediatePostDominators(pdg);

            RemovePseudoEdgeFromInfiniteLoopsToExitNode(graph, infiniteLoops, curProc.ExitNode);
            return(pdg);
        }
コード例 #2
0
        private DerivedGraph BuildDerivedGraph(ICollection <StructureNode> nodes, StructureNode entryNode)
        {
            DirectedGraph <StructureNode> graph = new StructureGraphAdapter(nodes);

            return(new DerivedGraph(graph, entryNode, ib.BuildIntervals(graph, entryNode)));
        }