Class BlockSorter
- Namespace
- Echo.ControlFlow.Serialization.Blocks
- Assembly
- Echo.ControlFlow.dll
Provides a mechanism for ordering nodes in control flow graph, based on the outgoing edges of every node.
public static class BlockSorter
- Inheritance
-
BlockSorter
- Inherited Members
Methods
SortNodes<TInstruction>(ControlFlowGraph<TInstruction>)
Determines an ordering of nodes in the control flow graph in such a way that the basic blocks can be concatenated together in sequence, and still result in a valid execution of the original program.
public static IEnumerable<ControlFlowNode<TInstruction>> SortNodes<TInstruction>(this ControlFlowGraph<TInstruction> cfg) where TInstruction : notnull
Parameters
cfgControlFlowGraph<TInstruction>The control flow graph to pull the nodes from.
Returns
- IEnumerable<ControlFlowNode<TInstruction>>
The ordering.
Type Parameters
TInstructionThe type of instructions stored in the graph.