public CallFlowNode AddCallNode( IRoutineLocation location, IEnumerable <Expression> arguments = null, IEnumerable <FlowVariable> returnAssignments = null, CallKind kind = CallKind.Static, FlowNodeFlags flags = FlowNodeFlags.None) { Contract.Requires <InvalidOperationException>(this.Graph != null); Contract.Requires <ArgumentNullException>(location != null, nameof(location)); Contract.Requires <ArgumentException>(kind != CallKind.ObjectCreation || location.IsConstructor, nameof(kind)); var nodeId = this.nodeIdProvider.GenerateNewId(); var node = new CallFlowNode( this.Graph, nodeId, flags, location, arguments ?? Enumerable.Empty <Expression>(), returnAssignments ?? Enumerable.Empty <FlowVariable>(), kind); this.Graph.MutableNodes.Add(node); Contract.Assert(nodeId.Value == this.Graph.MutableNodes.IndexOf(node)); return(node); }
public static OuterFlowEdge CreateReturn(OuterFlowEdgeId id, ReturnFlowNode returnNode, CallFlowNode callNode) { return(new OuterFlowEdge(id, OuterFlowEdgeKind.Return, returnNode, callNode)); }
public static OuterFlowEdge CreateMethodCall(OuterFlowEdgeId id, CallFlowNode callNode, EnterFlowNode enterNode) { return(new OuterFlowEdge(id, OuterFlowEdgeKind.MethodCall, callNode, enterNode)); }