Пример #1
0
        /// <summary>
        /// Pulls any updates from the provided node into the structure of the control flow graph.
        /// </summary>
        /// <param name="node">The node.</param>
        public bool UpdateFlowControl(ControlFlowNode <TInstruction> node)
        {
            var transaction = new ControlFlowGraphEditTransaction <TInstruction>();

            CheckForChangesInNode(transaction, node);

            if (transaction.Count > 0)
            {
                transaction.Apply(ControlFlowGraph);
                return(true);
            }

            return(false);
        }
Пример #2
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>
        public bool UpdateFlowControl()
        {
            var transaction = new ControlFlowGraphEditTransaction <TInstruction>();

            foreach (var node in ControlFlowGraph.Nodes)
            {
                CheckForChangesInNode(transaction, node);
            }

            if (transaction.Count > 0)
            {
                transaction.Apply(ControlFlowGraph);
                return(true);
            }

            return(false);
        }