/// <summary> /// Creates a new flow boundary instance. /// </summary> /// <param name="methodName">The containing method.</param> /// <param name="kind">The kind of the transferred flow control.</param> public FlowBoundary(string methodName, FlowKind kind) : base(new Label(), kind) { MethodName = methodName ?? "<root>"; var prefix = methodName == null ? "" : $"{methodName}:"; _label = kind == FlowKind.Start ? $"<{prefix}Start>" : $"<{prefix}End>"; }
/// <summary> /// Creates a new node in the control flow graph with the given IR instruction to represent /// and the given flow kind. /// </summary> /// <param name="instruction">The IR instruction to represent.</param> /// <param name="kind">The kind of flow represented by this instance.</param> public FlowNode(Instruction instruction, FlowKind kind) { Instruction = instruction; Kind = kind; }
private bool _IsExpectedBoundary(FlowNode node, string methodName, FlowKind kind) { return(node is FlowBoundary boundary && boundary.MethodName.Equals(methodName) && boundary.Kind == kind); }