예제 #1
0
 // Protected to allow extending and mocking
 protected Block()
 {
     this.instructions      = new Lazy <IReadOnlyList <SyntaxNode> >(() => ReversedInstructions.Reverse().ToImmutableArray());
     this.predecessorBlocks = new Lazy <IReadOnlyCollection <Block> >(() => EditablePredecessorBlocks.ToImmutableHashSet());
     this.allSuccessors     = new Lazy <ISet <Block> >(() => GetAll(this, b => b.SuccessorBlocks));
     this.allPredecessors   = new Lazy <ISet <Block> >(() => GetAll(this, b => b.PredecessorBlocks));
 }
예제 #2
0
        internal override Block GetPossibleNonEmptySuccessorBlock()
        {
            if (ReversedInstructions.Any())
            {
                return(this);
            }

            return(SuccessorBlock.GetPossibleNonEmptySuccessorBlock());
        }