4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
4933internal sealed partial class BoundEvaluationDecisionDagNode : BoundDecisionDagNode 4964internal sealed partial class BoundTestDecisionDagNode : BoundDecisionDagNode 4998internal sealed partial class BoundWhenDecisionDagNode : BoundDecisionDagNode 5033internal sealed partial class BoundLeafDecisionDagNode : BoundDecisionDagNode
153 references to BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (153)
Binder\DecisionDagBuilder.cs (16)
24/// sequence of binary tests. Each node is represented by a <see cref="BoundDecisionDagNode"/>. There are four 50/// <see cref="BoundDecisionDagNode"/> for each of them, containing 721var rootDecisionDagNode = decisionDag.RootNode.Dag; 733var node = sortedBoundDagNodes[i]; 948var uniqueNodes = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 949BoundDecisionDagNode uniqifyDagNode(BoundDecisionDagNode node) => uniqueNodes.GetOrAdd(node, node); 977BoundDecisionDagNode whenTrue = finalState(first.Syntax, first.CaseLabel, default); 978BoundDecisionDagNode? whenFalse = state.FalseBranch.Dag; 984BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 986BoundDecisionDagNode final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label)); 996BoundDecisionDagNode? next = state.TrueBranch!.Dag; 1004BoundDecisionDagNode? whenTrue = state.TrueBranch!.Dag; 1005BoundDecisionDagNode? whenFalse = state.FalseBranch!.Dag; 1775public 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 (4)
87bool wasAcyclic = TopologicalSort.TryIterativeSort<BoundDecisionDagNode>(SpecializedCollections.SingletonEnumerable(decisionDag.RootNode), nonNullSuccessors, out var nodes); 90foreach (var n in nodes) 110ImmutableArray<BoundDecisionDagNode> nonNullSuccessors(BoundDecisionDagNode n)
BoundTree\BoundDecisionDag.cs (30)
21private ImmutableArray<BoundDecisionDagNode> _topologicallySortedNodes; 23internal static ImmutableArray<BoundDecisionDagNode> Successors(BoundDecisionDagNode node) 32return ImmutableArray<BoundDecisionDagNode>.Empty; 47foreach (var node in this.TopologicallySortedNodes) 65public ImmutableArray<BoundDecisionDagNode> TopologicallySortedNodes 72bool wasAcyclic = TopologicalSort.TryIterativeSort<BoundDecisionDagNode>(SpecializedCollections.SingletonEnumerable(this.RootNode), Successors, out _topologicallySortedNodes); 87public BoundDecisionDag Rewrite(Func<BoundDecisionDagNode, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode>, BoundDecisionDagNode> makeReplacement) 92ImmutableArray<BoundDecisionDagNode> sortedNodes = this.TopologicallySortedNodes; 96var replacement = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 101BoundDecisionDagNode node = sortedNodes[i]; 103BoundDecisionDagNode newNode = makeReplacement(node, replacement); 108var newRoot = replacement[this.RootNode]; 114/// A trivial node replacement function for use with <see cref="Rewrite(Func{BoundDecisionDagNode, IReadOnlyDictionary{BoundDecisionDagNode, BoundDecisionDagNode}, BoundDecisionDagNode})"/>. 116public static BoundDecisionDagNode TrivialReplacement(BoundDecisionDagNode dag, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement) 150BoundDecisionDagNode makeReplacement(BoundDecisionDagNode dag, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement) 214foreach (var state in allStates)
FlowAnalysis\NullableWalker_Patterns.cs (5)
375var nodeStateMap = PooledDictionary<BoundDecisionDagNode, (PossiblyConditionalState state, bool believedReachable)>.GetInstance(); 380foreach (var dagNode in decisionDag.TopologicallySortedNodes) 732void gotoNodeWithCurrentState(BoundDecisionDagNode node, bool believedReachable) 764void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 861var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
4893public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors = false) 4902public BoundDecisionDagNode RootNode { get; } 4907public BoundDecisionDag Update(BoundDecisionDagNode rootNode) 4935public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false) 4947public BoundDecisionDagNode Next { get; } 4952public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation, BoundDecisionDagNode next) 4966public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false) 4980public BoundDecisionDagNode WhenTrue { get; } 4981public BoundDecisionDagNode WhenFalse { get; } 4986public BoundTestDecisionDagNode Update(BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse) 5000public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5015public BoundDecisionDagNode WhenTrue { get; } 5016public BoundDecisionDagNode? WhenFalse { get; } 5021public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse) 11150BoundDecisionDagNode rootNode = (BoundDecisionDagNode)this.Visit(node.RootNode); 11156BoundDecisionDagNode next = (BoundDecisionDagNode)this.Visit(node.Next); 11162BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11163BoundDecisionDagNode whenFalse = (BoundDecisionDagNode)this.Visit(node.WhenFalse); 11169BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11170BoundDecisionDagNode? 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) 374ImmutableArray<BoundDecisionDagNode> sortedNodes = decisionDag.TopologicallySortedNodes; 375var firstNode = sortedNodes[0]; 389ImmutableArray<BoundDecisionDagNode> nodesToLower = sortedNodes.WhereAsArray(n => n.Kind != BoundKind.WhenDecisionDagNode && n.Kind != BoundKind.LeafDecisionDagNode); 390var loweredNodes = PooledHashSet<BoundDecisionDagNode>.GetInstance(); 393BoundDecisionDagNode node = nodesToLower[i]; 419BoundDecisionDagNode nextNode = ((i + 1) < length) ? nodesToLower[i + 1] : null; 440BoundDecisionDagNode node, 441HashSet<BoundDecisionDagNode> loweredNodes, 442ImmutableArray<BoundDecisionDagNode> nodesToLower, 451var whenTrue = evaluationNode.Next; 452var whenFalse = testNode.WhenFalse; 458var nextNode = 472private void GenerateTest(BoundExpression test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, BoundDecisionDagNode nextNode) 499private bool GenerateSwitchDispatch(BoundDecisionDagNode node, HashSet<BoundDecisionDagNode> loweredNodes) 510bool canGenerateSwitchDispatch(BoundDecisionDagNode node) 551BoundDecisionDagNode node, 552HashSet<BoundDecisionDagNode> loweredNodes, 560BoundDecisionDagNode node, 561HashSet<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)