internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType) { this.BlockIndex = blockIndex; this.Offset = offset; this.NodeType = nodeType; this.Start = this.End = null; }
ControlFlowNode CreateEndNode(Statement statement, bool addToNodeList = true) { Statement nextStatement; if (statement == rootStatement) { nextStatement = null; } else { // Find the next statement in the same role: AstNode next = statement; do { next = next.NextSibling; } while (next != null && next.Role != statement.Role); nextStatement = next as Statement; } ControlFlowNodeType type = nextStatement != null ? ControlFlowNodeType.BetweenStatements : ControlFlowNodeType.EndNode; ControlFlowNode node = CreateNode(statement, nextStatement, type); if (addToNodeList) { nodes.Add(node); } return(node); }
public ControlFlowNode(StatementSyntax previousStatement, StatementSyntax nextStatement, ControlFlowNodeType type) { if (previousStatement == null && nextStatement == null) throw new ArgumentException("previousStatement and nextStatement must not be both null"); this.PreviousStatement = previousStatement; this.NextStatement = nextStatement; this.Type = type; }
internal ControlFlowNode(int blockIndex, ExceptionHandler exceptionHandler, ControlFlowNode endFinallyOrFaultNode) { this.BlockIndex = blockIndex; this.NodeType = endFinallyOrFaultNode != null ? ControlFlowNodeType.FinallyOrFaultHandler : ControlFlowNodeType.CatchHandler; this.ExceptionHandler = exceptionHandler; this.EndFinallyOrFaultNode = endFinallyOrFaultNode; Debug.Assert((exceptionHandler.HandlerType == ExceptionHandlerType.Finally || exceptionHandler.HandlerType == ExceptionHandlerType.Fault) == (endFinallyOrFaultNode != null)); this.Offset = exceptionHandler.HandlerStart.Offset; }
ControlFlowNode CreateSpecialNode(Statement statement, ControlFlowNodeType type, bool addToNodeList = true) { ControlFlowNode node = CreateNode(null, statement, type); if (addToNodeList) { nodes.Add(node); } return(node); }
public ControlFlowNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type) { if (previousStatement == null && nextStatement == null) { throw new ArgumentException("previousStatement and nextStatement must not be both null"); } this.PreviousStatement = previousStatement; this.NextStatement = nextStatement; this.Type = type; }
internal ControlFlowNode(int blockIndex, LinkedListNode <Instruction> start, LinkedListNode <Instruction> end) { if (start == null) { throw new ArgumentNullException("start"); } if (end == null) { throw new ArgumentNullException("end"); } this.BlockIndex = blockIndex; this.NodeType = ControlFlowNodeType.Normal; this.Start = start; this.End = end; this.Offset = start.Value.Offset; }
internal ControlFlowNode(int blockIndex, Instruction start, Instruction end) { if (start == null) { throw new ArgumentNullException("start"); } if (end == null) { throw new ArgumentNullException("end"); } this.BlockIndex = blockIndex; this.NodeType = ControlFlowNodeType.Normal; this.Start = start; this.End = end; this.Offset = start.Address; }
internal ControlFlowNode(int blockIndex, Instruction start, Instruction end) { if (start == null) { throw new ArgumentNullException("start"); } if (end == null) { throw new ArgumentNullException("end"); } BlockIndex = blockIndex; NodeType = ControlFlowNodeType.Normal; Start = start; End = end; Offset = start.Offset; }
ControlFlowNode CreateEndNode(StatementSyntax statement, bool addToNodeList = true) { StatementSyntax nextStatement; if (statement == rootStatement) { nextStatement = null; } else { // Find the next statement in the same role: var list = statement.Parent.ChildNodes().ToList(); var idx = list.IndexOf(statement); nextStatement = idx >= 0 && idx + 1 < list.Count ? list[idx + 1] as StatementSyntax : null; } ControlFlowNodeType type = nextStatement != null ? ControlFlowNodeType.BetweenStatements : ControlFlowNodeType.EndNode; ControlFlowNode node = CreateNode(statement, nextStatement, type); if (addToNodeList) { nodes.Add(node); } return(node); }
internal ControlFlowNode(int blockIndex, LinkedListNode<Instruction> start, LinkedListNode<Instruction> end) { if (start == null) throw new ArgumentNullException("start"); if (end == null) throw new ArgumentNullException("end"); this.BlockIndex = blockIndex; this.NodeType = ControlFlowNodeType.Normal; this.Start = start; this.End = end; this.Offset = start.Value.Offset; }
// Written according to the reachability rules in the C# spec (§8.1 End points and reachability) protected virtual ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type) { cancellationToken.ThrowIfCancellationRequested(); return(new ControlFlowNode(previousStatement, nextStatement, type)); }
internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType) { this.BlockIndex = blockIndex; this.Offset = offset; this.NodeType = nodeType; }
internal SsaBlock(ControlFlowNode node) { this.NodeType = node.NodeType; this.BlockIndex = node.BlockIndex; }
ControlFlowNode CreateSpecialNode(StatementSyntax statement, ControlFlowNodeType type, bool addToNodeList = true) { ControlFlowNode node = CreateNode(null, statement, type); if (addToNodeList) nodes.Add(node); return node; }
internal ControlFlowNode(int blockIndex, Instruction start, Instruction end) { if (start == null) throw new ArgumentNullException("start"); if (end == null) throw new ArgumentNullException("end"); BlockIndex = blockIndex; NodeType = ControlFlowNodeType.Normal; Start = start; End = end; Offset = start.Offset; }
internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType) { BlockIndex = blockIndex; Offset = offset; NodeType = nodeType; }
internal ControlFlowNode(int blockIndex) { this.BlockIndex = blockIndex; this.NodeType = ControlFlowNodeType.Normal; }
internal ControlFlowNode(int blockIndex, uint?offset, ControlFlowNodeType nodeType) { this.BlockIndex = blockIndex; this.Offset = offset; this.NodeType = nodeType; }
public DefiniteAssignmentNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type) : base(previousStatement, nextStatement, type) { }
protected override ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type) { return(new DefiniteAssignmentNode(previousStatement, nextStatement, type)); }
// Written according to the reachability rules in the C# spec (§8.1 End points and reachability) protected virtual ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type) { return(new ControlFlowNode(previousStatement, nextStatement, type)); }
internal ControlFlowNode(int blockIndex, ExceptionHandler exceptionHandler, ControlFlowNode endFinallyOrFaultNode) { BlockIndex = blockIndex; NodeType = endFinallyOrFaultNode != null ? ControlFlowNodeType.FinallyOrFaultHandler : ControlFlowNodeType.CatchHandler; ExceptionHandler = exceptionHandler; EndFinallyOrFaultNode = endFinallyOrFaultNode; Debug.Assert((exceptionHandler.HandlerType == ExceptionHandlerType.Finally || exceptionHandler.HandlerType == ExceptionHandlerType.Fault) == (endFinallyOrFaultNode != null)); Offset = exceptionHandler.HandlerStart.Offset; }
// Written according to the reachability rules in the C# spec (§8.1 End points and reachability) protected virtual ControlFlowNode CreateNode(StatementSyntax previousStatement, StatementSyntax nextStatement, ControlFlowNodeType type) { cancellationToken.ThrowIfCancellationRequested(); return new ControlFlowNode(previousStatement, nextStatement, type); }