4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
5045internal sealed partial class BoundEvaluationDecisionDagNode : BoundDecisionDagNode 5076internal sealed partial class BoundTestDecisionDagNode : BoundDecisionDagNode 5110internal sealed partial class BoundWhenDecisionDagNode : BoundDecisionDagNode 5145internal sealed partial class BoundLeafDecisionDagNode : BoundDecisionDagNode
148 references to BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (148)
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 754var rootDecisionDagNode = decisionDag.RootNode.Dag; 776var node = sortedBoundDagNodes[i]; 997var uniqueNodes = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 998BoundDecisionDagNode uniqifyDagNode(BoundDecisionDagNode node) => uniqueNodes.GetOrAdd(node, node); 1026BoundDecisionDagNode whenTrue = finalState(first.Syntax, first.CaseLabel, default); 1027BoundDecisionDagNode? whenFalse = state.FalseBranch.Dag; 1033BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 1035BoundDecisionDagNode final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label)); 1045BoundDecisionDagNode? next = state.TrueBranch!.Dag; 1053BoundDecisionDagNode? whenTrue = state.TrueBranch!.Dag; 1054BoundDecisionDagNode? whenFalse = state.FalseBranch!.Dag; 1872public BoundDecisionDagNode? Dag;
Binder\PatternExplainer.cs (23)
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) 113var pathBuilder = ArrayBuilder<BoundDecisionDagNode>.GetInstance(); 120bool exploreToNode(BoundDecisionDagNode currentNode, bool currentRequiresFalseWhenClause) 181ImmutableArray<BoundDecisionDagNode> nodes, 182BoundDecisionDagNode targetNode, 210static string samplePatternFromOtherPaths(BoundDagTemp rootIdentifier, BoundDecisionDagNode rootNode, 211BoundDecisionDagNode targetNode, bool nullPaths, out bool requiresFalseWhenClause, out bool unnamedEnumValue) 244static void gatherConstraintsAndEvaluations(BoundDecisionDagNode targetNode, ImmutableArray<BoundDecisionDagNode> pathToNode, 252BoundDecisionDagNode node = pathToNode[i]; 257BoundDecisionDagNode nextNode = (i < n - 1) ? pathToNode[i + 1] : targetNode;
Binder\SwitchExpressionBinder.cs (2)
111static void addNonNullSuccessors(ref TemporaryArray<BoundDecisionDagNode> builder, BoundDecisionDagNode n)
BoundTree\BoundDecisionDag.cs (27)
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); 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) 772void gotoNodeWithCurrentState(BoundDecisionDagNode node, bool believedReachable) 804void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 901var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
5005public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors = false) 5014public BoundDecisionDagNode RootNode { get; } 5019public BoundDecisionDag Update(BoundDecisionDagNode rootNode) 5047public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false) 5059public BoundDecisionDagNode Next { get; } 5064public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation, BoundDecisionDagNode next) 5078public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false) 5092public BoundDecisionDagNode WhenTrue { get; } 5093public BoundDecisionDagNode WhenFalse { get; } 5098public BoundTestDecisionDagNode Update(BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse) 5112public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5127public BoundDecisionDagNode WhenTrue { get; } 5128public BoundDecisionDagNode? WhenFalse { get; } 5133public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse) 11546BoundDecisionDagNode rootNode = (BoundDecisionDagNode)this.Visit(node.RootNode); 11552BoundDecisionDagNode next = (BoundDecisionDagNode)this.Visit(node.Next); 11558BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11559BoundDecisionDagNode whenFalse = (BoundDecisionDagNode)this.Visit(node.WhenFalse); 11565BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11566BoundDecisionDagNode? 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)
534foreach (BoundDecisionDagNode node in decisionDag.TopologicallySortedNodes) 578static bool usesOriginalInput(BoundDecisionDagNode node) 655static 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)