Пример #1
0
        public static ControlFlowGraph GenerateNormalControlFlow(MethodBody method)
        {
            var instructions = ControlFlowGraph.FilterExceptionHandlers(method);
            var leaders      = ControlFlowGraph.CreateNodes(instructions);
            var cfg          = ControlFlowGraph.ConnectNodes(instructions, leaders);

            return(cfg);
        }
Пример #2
0
        public static ControlFlowGraph GenerateExceptionalControlFlow(MethodBody method)
        {
            var instructions = method.Instructions;
            var leaders      = ControlFlowGraph.CreateNodes(instructions);
            var cfg          = ControlFlowGraph.ConnectNodes(instructions, leaders);

            ControlFlowGraph.ConnectNodesWithExceptionHandlers(cfg, method.ProtectedBlocks, leaders);

            return(cfg);
        }