コード例 #1
0
 internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType)
 {
     this.BlockIndex = blockIndex;
     this.Offset     = offset;
     this.NodeType   = nodeType;
     this.Start      = this.End = null;
 }
コード例 #2
0
ファイル: ControlFlow.cs プロジェクト: xiaotie/NRefactory
        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);
        }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
ファイル: ControlFlow.cs プロジェクト: xiaotie/NRefactory
        ControlFlowNode CreateSpecialNode(Statement statement, ControlFlowNodeType type, bool addToNodeList = true)
        {
            ControlFlowNode node = CreateNode(null, statement, type);

            if (addToNodeList)
            {
                nodes.Add(node);
            }
            return(node);
        }
コード例 #6
0
ファイル: ControlFlow.cs プロジェクト: xiaotie/NRefactory
 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;
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
        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);
        }
コード例 #11
0
ファイル: ControlFlowNode.cs プロジェクト: lisong521/dnSpy
		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;
		}
コード例 #12
0
ファイル: ControlFlow.cs プロジェクト: xiaotie/NRefactory
        // 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));
        }
コード例 #13
0
		internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType)
		{
			this.BlockIndex = blockIndex;
			this.Offset = offset;
			this.NodeType = nodeType;
		}
コード例 #14
0
ファイル: SsaBlock.cs プロジェクト: FaceHunter/ILSpy
		internal SsaBlock(ControlFlowNode node)
		{
			this.NodeType = node.NodeType;
			this.BlockIndex = node.BlockIndex;
		}
コード例 #15
0
 ControlFlowNode CreateSpecialNode(StatementSyntax statement, ControlFlowNodeType type, bool addToNodeList = true)
 {
     ControlFlowNode node = CreateNode(null, statement, type);
     if (addToNodeList)
         nodes.Add(node);
     return node;
 }
コード例 #16
0
		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;
		}
コード例 #17
0
ファイル: SsaBlock.cs プロジェクト: ropean/Usable
 internal SsaBlock(ControlFlowNode node)
 {
     this.NodeType   = node.NodeType;
     this.BlockIndex = node.BlockIndex;
 }
コード例 #18
0
 internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType)
 {
     BlockIndex = blockIndex;
     Offset     = offset;
     NodeType   = nodeType;
 }
コード例 #19
0
ファイル: ControlFlowNode.cs プロジェクト: WarlockD/GMdsam
 internal ControlFlowNode(int blockIndex)
 {
     this.BlockIndex = blockIndex;
     this.NodeType = ControlFlowNodeType.Normal;
 }
コード例 #20
0
 internal ControlFlowNode(int blockIndex, uint?offset, ControlFlowNodeType nodeType)
 {
     this.BlockIndex = blockIndex;
     this.Offset     = offset;
     this.NodeType   = nodeType;
 }
コード例 #21
0
 internal ControlFlowNode(int blockIndex)
 {
     this.BlockIndex = blockIndex;
     this.NodeType   = ControlFlowNodeType.Normal;
 }
コード例 #22
0
 public DefiniteAssignmentNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)
     : base(previousStatement, nextStatement, type)
 {
 }
コード例 #23
0
 protected override ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)
 {
     return(new DefiniteAssignmentNode(previousStatement, nextStatement, type));
 }
コード例 #24
0
		internal ControlFlowNode(int blockIndex, int offset, ControlFlowNodeType nodeType)
		{
			BlockIndex = blockIndex;
			Offset = offset;
			NodeType = nodeType;
		}
コード例 #25
0
        // 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));
        }
コード例 #26
0
		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;
		}
コード例 #27
0
        // 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);
        }