Beispiel #1
0
 /// <summary>
 /// Creates a new control flow node containing the provided basic block of instructions, to be added to the graph.
 /// </summary>
 /// <param name="offset">The offset of the node.</param>
 /// <param name="basicBlock">The basic block to store in the node.</param>
 public ControlFlowNode(long offset, BasicBlock <TInstruction> basicBlock)
 {
     Offset           = offset;
     Contents         = basicBlock ?? throw new ArgumentNullException(nameof(basicBlock));
     ConditionalEdges = new AdjacencyCollection <TInstruction>(this, ControlFlowEdgeType.Conditional);
     AbnormalEdges    = new AdjacencyCollection <TInstruction>(this, ControlFlowEdgeType.Abnormal);
 }
Beispiel #2
0
 private void AddAdjacencyListToResult(
     ICollection <ControlFlowNode <TInstruction> > result,
     AdjacencyCollection <TInstruction> adjacency)
 {
     foreach (var edge in adjacency)
     {
         AddSuccessorToResult(result, edge.Target);
     }
 }