// 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)); }
internal override Block GetPossibleNonEmptySuccessorBlock() { if (ReversedInstructions.Any()) { return(this); } return(SuccessorBlock.GetPossibleNonEmptySuccessorBlock()); }