static void FindLoopContents(ControlStructure current, HashSet <ControlFlowNode> loopContents, ControlFlowNode loopHead, ControlFlowNode node) { if (current.AllNodes.Contains(node) && loopHead.Dominates(node) && loopContents.Add(node)) { foreach (var edge in node.Incoming) { FindLoopContents(current, loopContents, loopHead, edge.Source); } } }
void CreateEdge(ControlFlowNode fromNode, Instruction toInstruction, JumpType type) { CreateEdge(fromNode, nodes.Single(n => n.Start == toInstruction), type); }
public CopyFinallySubGraphLogic(ControlFlowGraphBuilder builder, ControlFlowNode start, ControlFlowNode end, ControlFlowNode newEnd) { this.builder = builder; this.start = start; this.end = end; this.newEnd = newEnd; }
/// <summary> /// Creates a copy of all nodes pointing to 'end' and replaces those references with references to 'newEnd'. /// Nodes pointing to the copied node are copied recursively to update those references, too. /// This recursion stops at 'start'. The modified version of start is returned. /// </summary> ControlFlowNode CopyFinallySubGraph(ControlFlowNode start, ControlFlowNode end, ControlFlowNode newEnd) { return(new CopyFinallySubGraphLogic(this, start, end, newEnd).CopyFinallySubGraph()); }
public ControlFlowEdge(ControlFlowNode source, ControlFlowNode target) : this(source, target, JumpType.Normal) { }
public ControlFlowEdge(ControlFlowNode source, ControlFlowNode target, JumpType type) { this.Source = source; this.Target = target; this.Type = type; }