4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
5046internal sealed partial class BoundEvaluationDecisionDagNode : BoundDecisionDagNode 5077internal sealed partial class BoundTestDecisionDagNode : BoundDecisionDagNode 5111internal sealed partial class BoundWhenDecisionDagNode : BoundDecisionDagNode 5146internal sealed partial class BoundLeafDecisionDagNode : BoundDecisionDagNode
151 references to BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (151)
Binder\DecisionDagBuilder.cs (16)
25/// sequence of binary tests. Each node is represented by a <see cref="BoundDecisionDagNode"/>. There are four 46/// create a new <see cref="BoundDecisionDagNode"/> for each of them, containing the state transitions (including 802var rootDecisionDagNode = decisionDag.RootNode.Dag; 824var node = sortedBoundDagNodes[i]; 1045var uniqueNodes = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 1046BoundDecisionDagNode uniqifyDagNode(BoundDecisionDagNode node) => uniqueNodes.GetOrAdd(node, node); 1074BoundDecisionDagNode whenTrue = finalState(first.Syntax, first.CaseLabel, default); 1075BoundDecisionDagNode? whenFalse = state.FalseBranch.Dag; 1081BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 1083BoundDecisionDagNode final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label)); 1093BoundDecisionDagNode? next = state.TrueBranch!.Dag; 1101BoundDecisionDagNode? whenTrue = state.TrueBranch!.Dag; 1102BoundDecisionDagNode? whenFalse = state.FalseBranch!.Dag; 1916public BoundDecisionDagNode? Dag;
Binder\PatternExplainer.cs (24)
31private static ImmutableArray<BoundDecisionDagNode> ShortestPathToNode( 32ImmutableArray<BoundDecisionDagNode> nodes, 33BoundDecisionDagNode node, 38var dist = PooledDictionary<BoundDecisionDagNode, (int distance, BoundDecisionDagNode next)>.GetInstance(); 41int distance(BoundDecisionDagNode x) 53var n = nodes[i]; 73var result = ArrayBuilder<BoundDecisionDagNode>.GetInstance(capacity: distanceToNode); 74for (BoundDecisionDagNode n = nodes[0]; n != node;) 83(int d, BoundDecisionDagNode next) = dist[t]; 110private static void VisitPathsToNode(BoundDecisionDagNode rootNode, BoundDecisionDagNode targetNode, bool nullPaths, 111Func<ImmutableArray<BoundDecisionDagNode>, bool, bool> handler) 114var pathBuilder = ArrayBuilder<BoundDecisionDagNode>.GetInstance(); 115var stack = ArrayBuilder<BoundDecisionDagNode?>.GetInstance(); 123bool exploreToNode(BoundDecisionDagNode? currentNode, bool currentRequiresFalseWhenClause) 221ImmutableArray<BoundDecisionDagNode> nodes, 222BoundDecisionDagNode targetNode, 250static string samplePatternFromOtherPaths(BoundDagTemp rootIdentifier, BoundDecisionDagNode rootNode, 251BoundDecisionDagNode targetNode, bool nullPaths, out bool requiresFalseWhenClause, out bool unnamedEnumValue) 284static void gatherConstraintsAndEvaluations(BoundDecisionDagNode targetNode, ImmutableArray<BoundDecisionDagNode> pathToNode, 292BoundDecisionDagNode node = pathToNode[i]; 297BoundDecisionDagNode nextNode = (i < n - 1) ? pathToNode[i + 1] : targetNode;
Binder\SwitchExpressionBinder.cs (3)
101foreach (var n in nodes) 122static void addNonNullSuccessors(ref TemporaryArray<BoundDecisionDagNode> builder, BoundDecisionDagNode n)
BoundTree\BoundDecisionDag.cs (28)
22private ImmutableArray<BoundDecisionDagNode> _topologicallySortedNodes; 24internal static void AddSuccessors(ref TemporaryArray<BoundDecisionDagNode> builder, BoundDecisionDagNode node) 53foreach (var node in this.TopologicallySortedNodes) 71public ImmutableArray<BoundDecisionDagNode> TopologicallySortedNodes 93public BoundDecisionDag Rewrite(Func<BoundDecisionDagNode, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode>, BoundDecisionDagNode> makeReplacement) 98ImmutableArray<BoundDecisionDagNode> sortedNodes = this.TopologicallySortedNodes; 102var replacement = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 107BoundDecisionDagNode node = sortedNodes[i]; 109BoundDecisionDagNode newNode = makeReplacement(node, replacement); 114var newRoot = replacement[this.RootNode]; 120/// A trivial node replacement function for use with <see cref="Rewrite(Func{BoundDecisionDagNode, IReadOnlyDictionary{BoundDecisionDagNode, BoundDecisionDagNode}, BoundDecisionDagNode})"/>. 122public static BoundDecisionDagNode TrivialReplacement(BoundDecisionDagNode dag, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement) 156BoundDecisionDagNode makeReplacement(BoundDecisionDagNode dag, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement) 220foreach (var state in allStates)
FlowAnalysis\NullableWalker_Patterns.cs (5)
413var nodeStateMap = PooledDictionary<BoundDecisionDagNode, (PossiblyConditionalState state, bool believedReachable)>.GetInstance(); 418foreach (var dagNode in decisionDag.TopologicallySortedNodes) 774void gotoNodeWithCurrentState(BoundDecisionDagNode node, bool believedReachable) 806void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 903var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
5006public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors = false) 5015public BoundDecisionDagNode RootNode { get; } 5020public BoundDecisionDag Update(BoundDecisionDagNode rootNode) 5048public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false) 5060public BoundDecisionDagNode Next { get; } 5065public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation, BoundDecisionDagNode next) 5079public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false) 5093public BoundDecisionDagNode WhenTrue { get; } 5094public BoundDecisionDagNode WhenFalse { get; } 5099public BoundTestDecisionDagNode Update(BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse) 5113public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5128public BoundDecisionDagNode WhenTrue { get; } 5129public BoundDecisionDagNode? WhenFalse { get; } 5134public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse) 11681BoundDecisionDagNode rootNode = (BoundDecisionDagNode)this.Visit(node.RootNode); 11687BoundDecisionDagNode next = (BoundDecisionDagNode)this.Visit(node.Next); 11693BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11694BoundDecisionDagNode whenFalse = (BoundDecisionDagNode)this.Visit(node.WhenFalse); 11700BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11701BoundDecisionDagNode? whenFalse = (BoundDecisionDagNode?)this.Visit(node.WhenFalse);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (34)
43private readonly PooledDictionary<BoundDecisionDagNode, LabelSymbol> _dagNodeLabels = PooledDictionary<BoundDecisionDagNode, LabelSymbol>.GetInstance(); 65var hasPredecessor = PooledHashSet<BoundDecisionDagNode>.GetInstance(); 66foreach (BoundDecisionDagNode node in decisionDag.TopologicallySortedNodes) 96void notePredecessor(BoundDecisionDagNode successor) 111protected virtual LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag) 373ImmutableArray<BoundDecisionDagNode> sortedNodes = decisionDag.TopologicallySortedNodes; 374var firstNode = sortedNodes[0]; 388ImmutableArray<BoundDecisionDagNode> nodesToLower = sortedNodes.WhereAsArray(n => n.Kind != BoundKind.WhenDecisionDagNode && n.Kind != BoundKind.LeafDecisionDagNode); 389var loweredNodes = PooledHashSet<BoundDecisionDagNode>.GetInstance(); 392BoundDecisionDagNode node = nodesToLower[i]; 418BoundDecisionDagNode nextNode = ((i + 1) < length) ? nodesToLower[i + 1] : null; 439BoundDecisionDagNode node, 440HashSet<BoundDecisionDagNode> loweredNodes, 441ImmutableArray<BoundDecisionDagNode> nodesToLower, 450var whenTrue = evaluationNode.Next; 451var whenFalse = testNode.WhenFalse; 457var nextNode = 471private void GenerateTest(BoundExpression test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, BoundDecisionDagNode nextNode) 498private bool GenerateSwitchDispatch(BoundDecisionDagNode node, HashSet<BoundDecisionDagNode> loweredNodes) 509bool canGenerateSwitchDispatch(BoundDecisionDagNode node) 550BoundDecisionDagNode node, 551HashSet<BoundDecisionDagNode> loweredNodes, 559BoundDecisionDagNode node, 560HashSet<BoundDecisionDagNode> loweredNodes, 970private void LowerWhenClauses(ImmutableArray<BoundDecisionDagNode> sortedNodes) 1004foreach (BoundDecisionDagNode node in sortedNodes) 1031foreach (BoundDecisionDagNode node in sortedNodes) 1159var whenFalse = whenClause.WhenFalse; 1198private void LowerDecisionDagNode(BoundDecisionDagNode node, BoundDecisionDagNode nextNode)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (6)
538foreach (BoundDecisionDagNode node in decisionDag.TopologicallySortedNodes) 582static bool usesOriginalInput(BoundDecisionDagNode node) 659static BoundDecisionDagNode makeReplacement(BoundDecisionDagNode node, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement)
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (4)
57BoundDecisionDagNode node, 137private static bool IsFailureNode(BoundDecisionDagNode node, LabelSymbol whenFalseLabel) 230var node = decisionDag.RootNode; 238BoundDecisionDagNode node,
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
40protected override LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag)