4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
5086internal sealed partial class BoundEvaluationDecisionDagNode : BoundDecisionDagNode 5117internal sealed partial class BoundTestDecisionDagNode : BoundDecisionDagNode 5151internal sealed partial class BoundWhenDecisionDagNode : BoundDecisionDagNode 5186internal sealed partial class BoundLeafDecisionDagNode : BoundDecisionDagNode
156 references to BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (156)
Binder\DecisionDagBuilder.cs (16)
24/// sequence of binary tests. Each node is represented by a <see cref="BoundDecisionDagNode"/>. There are four 45/// create a new <see cref="BoundDecisionDagNode"/> for each of them, containing the state transitions (including 1223var rootDecisionDagNode = decisionDag.RootNode.Dag; 1246var node = sortedBoundDagNodes[i]; 1623var uniqueNodes = PooledDictionary<BoundDecisionDagNode, BoundDecisionDagNode>.GetInstance(); 1624BoundDecisionDagNode uniqifyDagNode(BoundDecisionDagNode node) => uniqueNodes.GetOrAdd(node, node); 1652BoundDecisionDagNode whenTrue = finalState(first.Syntax, first.CaseLabel, default); 1653BoundDecisionDagNode? whenFalse = state.FalseBranch.Dag; 1659BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 1661BoundDecisionDagNode final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label)); 1671BoundDecisionDagNode? next = state.TrueBranch!.Dag; 1679BoundDecisionDagNode? whenTrue = state.TrueBranch!.Dag; 1680BoundDecisionDagNode? whenFalse = state.FalseBranch!.Dag; 3042public BoundDecisionDagNode? Dag;
Binder\PatternExplainer.cs (25)
31private static ImmutableArray<BoundDecisionDagNode> ShortestPathToNode( 32ImmutableArray<BoundDecisionDagNode> nodes, 33BoundDecisionDagNode node, 41var dist = PooledDictionary<BoundDecisionDagNode, (int distance, BoundDecisionDagNode next)>.GetInstance(); 44int distance(BoundDecisionDagNode x) 56var n = nodes[i]; 58(int distance, BoundDecisionDagNode next) distanceInfo; 95var result = ArrayBuilder<BoundDecisionDagNode>.GetInstance(capacity: distanceToNode); 96for (BoundDecisionDagNode n = nodes[0]; n != node;) 105(int d, BoundDecisionDagNode next) = dist[t]; 132private static void VisitPathsToNode(BoundDecisionDagNode rootNode, BoundDecisionDagNode targetNode, bool nullPaths, 133Func<ImmutableArray<BoundDecisionDagNode>, bool, bool> handler) 136var pathBuilder = ArrayBuilder<BoundDecisionDagNode>.GetInstance(); 137var stack = ArrayBuilder<BoundDecisionDagNode?>.GetInstance(); 145bool exploreToNode(BoundDecisionDagNode? currentNode, bool currentRequiresFalseWhenClause) 244ImmutableArray<BoundDecisionDagNode> nodes, 245BoundDecisionDagNode targetNode, 276static string samplePatternFromOtherPaths(Binder binder, BoundDagTemp rootIdentifier, BoundDecisionDagNode rootNode, 277BoundDecisionDagNode targetNode, bool nullPaths, out bool requiresFalseWhenClause, out bool unnamedEnumValue) 310static void gatherConstraintsAndEvaluations(Binder binder, BoundDecisionDagNode targetNode, ImmutableArray<BoundDecisionDagNode> pathToNode, 318BoundDecisionDagNode node = pathToNode[i]; 323BoundDecisionDagNode 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) 215foreach (var state in allStates)
FlowAnalysis\NullableWalker_Patterns.cs (9)
418var nodeStateMap = PooledDictionary<BoundDecisionDagNode, (PossiblyConditionalState state, bool believedReachable)>.GetInstance(); 423foreach (var dagNode in decisionDag.TopologicallySortedNodes) 885void gotoNodeWithCurrentState(BoundDecisionDagNode node, bool believedReachable, BoundDecisionDagNode from, bool whenTrueBranch) 922void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable, BoundDecisionDagNode from, bool whenTrueBranch) 1045internal readonly struct DecisionDagReachabilityInfo(BoundDecisionDagNode source, bool whenTrue) : IEquatable<DecisionDagReachabilityInfo> 1047public readonly BoundDecisionDagNode Source = source; 1093var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
5044public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool suitableForLowering, bool hasErrors = false) 5054public BoundDecisionDagNode RootNode { get; } 5060public BoundDecisionDag Update(BoundDecisionDagNode rootNode, bool suitableForLowering) 5088public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false) 5100public BoundDecisionDagNode Next { get; } 5105public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation, BoundDecisionDagNode next) 5119public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false) 5133public BoundDecisionDagNode WhenTrue { get; } 5134public BoundDecisionDagNode WhenFalse { get; } 5139public BoundTestDecisionDagNode Update(BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse) 5153public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5168public BoundDecisionDagNode WhenTrue { get; } 5169public BoundDecisionDagNode? WhenFalse { get; } 5174public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse) 11948BoundDecisionDagNode rootNode = (BoundDecisionDagNode)this.Visit(node.RootNode); 11954BoundDecisionDagNode next = (BoundDecisionDagNode)this.Visit(node.Next); 11960BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11961BoundDecisionDagNode whenFalse = (BoundDecisionDagNode)this.Visit(node.WhenFalse); 11967BoundDecisionDagNode whenTrue = (BoundDecisionDagNode)this.Visit(node.WhenTrue); 11968BoundDecisionDagNode? whenFalse = (BoundDecisionDagNode?)this.Visit(node.WhenFalse);
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)
46protected override LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag)
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, 978private void LowerWhenClauses(ImmutableArray<BoundDecisionDagNode> sortedNodes) 1012foreach (BoundDecisionDagNode node in sortedNodes) 1039foreach (BoundDecisionDagNode node in sortedNodes) 1167var whenFalse = whenClause.WhenFalse; 1206private void LowerDecisionDagNode(BoundDecisionDagNode node, BoundDecisionDagNode nextNode)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (6)
569foreach (BoundDecisionDagNode node in decisionDag.TopologicallySortedNodes) 613static bool usesOriginalInput(BoundDecisionDagNode node) 690static BoundDecisionDagNode makeReplacement(BoundDecisionDagNode node, IReadOnlyDictionary<BoundDecisionDagNode, BoundDecisionDagNode> replacement)