예제 #1
0
        /// <summary>
        /// Traverses all nodes in the control flow graph, and synchronizes the structure of the graph with the contents
        /// of each basic block within the traversed nodes.
        /// </summary>
        /// <param name="graph">The graph to synchronize.</param>
        /// <param name="successorResolver">The object to use for resolving successors of a single instruction.</param>
        /// <param name="flags">Flags indicating several options for updating the control flow graph.</param>
        /// <typeparam name="TInstruction">The type of instructions stored in the control flow graph.</typeparam>
        /// <returns><c>true</c> if any changes were made, <c>false</c> otherwise.</returns>
        public static bool UpdateFlowControl <TInstruction>(
            this ControlFlowGraph <TInstruction> graph,
            IStaticSuccessorResolver <TInstruction> successorResolver,
            FlowControlSynchronizationFlags flags)
        {
            var synchronizer = new FlowControlSynchronizer <TInstruction>(graph, successorResolver, flags);

            return(synchronizer.UpdateFlowControl());
        }
예제 #2
0
        /// <summary>
        /// Pulls any updates from the basic block embedded in the node, and updates the parent control flow graph
        /// accordingly.
        /// </summary>
        /// <param name="node">The node to pull updates from.</param>
        /// <param name="successorResolver">The object to use for resolving successors of a single instruction.</param>
        /// <param name="flags">Flags indicating several options for updating the control flow graph.</param>
        /// <typeparam name="TInstruction">The type of instructions stored in the control flow graph.</typeparam>
        /// <returns><c>true</c> if any changes were made, <c>false</c> otherwise.</returns>
        public static bool UpdateFlowControl <TInstruction>(
            this ControlFlowNode <TInstruction> node,
            IStaticSuccessorResolver <TInstruction> successorResolver,
            FlowControlSynchronizationFlags flags)
        {
            var synchronizer = new FlowControlSynchronizer <TInstruction>(node.ParentGraph, successorResolver, flags);

            return(synchronizer.UpdateFlowControl(node));
        }