4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
5086
internal sealed partial class BoundEvaluationDecisionDagNode :
BoundDecisionDagNode
5117
internal sealed partial class BoundTestDecisionDagNode :
BoundDecisionDagNode
5151
internal sealed partial class BoundWhenDecisionDagNode :
BoundDecisionDagNode
5186
internal 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
1223
var
rootDecisionDagNode = decisionDag.RootNode.Dag;
1246
var
node = sortedBoundDagNodes[i];
1623
var uniqueNodes = PooledDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
>.GetInstance();
1624
BoundDecisionDagNode
uniqifyDagNode(
BoundDecisionDagNode
node) => uniqueNodes.GetOrAdd(node, node);
1652
BoundDecisionDagNode
whenTrue = finalState(first.Syntax, first.CaseLabel, default);
1653
BoundDecisionDagNode
? whenFalse = state.FalseBranch.Dag;
1659
BoundDecisionDagNode
finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings)
1661
BoundDecisionDagNode
final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label));
1671
BoundDecisionDagNode
? next = state.TrueBranch!.Dag;
1679
BoundDecisionDagNode
? whenTrue = state.TrueBranch!.Dag;
1680
BoundDecisionDagNode
? whenFalse = state.FalseBranch!.Dag;
3042
public
BoundDecisionDagNode
? Dag;
Binder\PatternExplainer.cs (25)
31
private static ImmutableArray<
BoundDecisionDagNode
> ShortestPathToNode(
32
ImmutableArray<
BoundDecisionDagNode
> nodes,
33
BoundDecisionDagNode
node,
41
var dist = PooledDictionary<
BoundDecisionDagNode
, (int distance,
BoundDecisionDagNode
next)>.GetInstance();
44
int distance(
BoundDecisionDagNode
x)
56
var
n = nodes[i];
58
(int distance,
BoundDecisionDagNode
next) distanceInfo;
95
var result = ArrayBuilder<
BoundDecisionDagNode
>.GetInstance(capacity: distanceToNode);
96
for (
BoundDecisionDagNode
n = nodes[0]; n != node;)
105
(int d,
BoundDecisionDagNode
next) = dist[t];
132
private static void VisitPathsToNode(
BoundDecisionDagNode
rootNode,
BoundDecisionDagNode
targetNode, bool nullPaths,
133
Func<ImmutableArray<
BoundDecisionDagNode
>, bool, bool> handler)
136
var pathBuilder = ArrayBuilder<
BoundDecisionDagNode
>.GetInstance();
137
var stack = ArrayBuilder<
BoundDecisionDagNode
?>.GetInstance();
145
bool exploreToNode(
BoundDecisionDagNode
? currentNode, bool currentRequiresFalseWhenClause)
244
ImmutableArray<
BoundDecisionDagNode
> nodes,
245
BoundDecisionDagNode
targetNode,
276
static string samplePatternFromOtherPaths(Binder binder, BoundDagTemp rootIdentifier,
BoundDecisionDagNode
rootNode,
277
BoundDecisionDagNode
targetNode, bool nullPaths, out bool requiresFalseWhenClause, out bool unnamedEnumValue)
310
static void gatherConstraintsAndEvaluations(Binder binder,
BoundDecisionDagNode
targetNode, ImmutableArray<
BoundDecisionDagNode
> pathToNode,
318
BoundDecisionDagNode
node = pathToNode[i];
323
BoundDecisionDagNode
nextNode = (i < n - 1) ? pathToNode[i + 1] : targetNode;
Binder\SwitchExpressionBinder.cs (3)
101
foreach (
var
n in nodes)
122
static void addNonNullSuccessors(ref TemporaryArray<
BoundDecisionDagNode
> builder,
BoundDecisionDagNode
n)
BoundTree\BoundDecisionDag.cs (28)
22
private ImmutableArray<
BoundDecisionDagNode
> _topologicallySortedNodes;
24
internal static void AddSuccessors(ref TemporaryArray<
BoundDecisionDagNode
> builder,
BoundDecisionDagNode
node)
53
foreach (
var
node in this.TopologicallySortedNodes)
71
public ImmutableArray<
BoundDecisionDagNode
> TopologicallySortedNodes
93
public BoundDecisionDag Rewrite(Func<
BoundDecisionDagNode
, IReadOnlyDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
>,
BoundDecisionDagNode
> makeReplacement)
98
ImmutableArray<
BoundDecisionDagNode
> sortedNodes = this.TopologicallySortedNodes;
102
var replacement = PooledDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
>.GetInstance();
107
BoundDecisionDagNode
node = sortedNodes[i];
109
BoundDecisionDagNode
newNode = makeReplacement(node, replacement);
114
var
newRoot = replacement[this.RootNode];
120
/// A trivial node replacement function for use with <see cref="Rewrite(Func{
BoundDecisionDagNode
, IReadOnlyDictionary{
BoundDecisionDagNode
,
BoundDecisionDagNode
},
BoundDecisionDagNode
})"/>.
122
public static
BoundDecisionDagNode
TrivialReplacement(
BoundDecisionDagNode
dag, IReadOnlyDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
> replacement)
156
BoundDecisionDagNode
makeReplacement(
BoundDecisionDagNode
dag, IReadOnlyDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
> replacement)
215
foreach (
var
state in allStates)
FlowAnalysis\NullableWalker_Patterns.cs (9)
418
var nodeStateMap = PooledDictionary<
BoundDecisionDagNode
, (PossiblyConditionalState state, bool believedReachable)>.GetInstance();
423
foreach (
var
dagNode in decisionDag.TopologicallySortedNodes)
885
void gotoNodeWithCurrentState(
BoundDecisionDagNode
node, bool believedReachable,
BoundDecisionDagNode
from, bool whenTrueBranch)
922
void gotoNode(
BoundDecisionDagNode
node, LocalState state, bool believedReachable,
BoundDecisionDagNode
from, bool whenTrueBranch)
1045
internal readonly struct DecisionDagReachabilityInfo(
BoundDecisionDagNode
source, bool whenTrue) : IEquatable<DecisionDagReachabilityInfo>
1047
public readonly
BoundDecisionDagNode
Source = source;
1093
var
leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
5044
public BoundDecisionDag(SyntaxNode syntax,
BoundDecisionDagNode
rootNode, bool suitableForLowering, bool hasErrors = false)
5054
public
BoundDecisionDagNode
RootNode { get; }
5060
public BoundDecisionDag Update(
BoundDecisionDagNode
rootNode, bool suitableForLowering)
5088
public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation,
BoundDecisionDagNode
next, bool hasErrors = false)
5100
public
BoundDecisionDagNode
Next { get; }
5105
public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation,
BoundDecisionDagNode
next)
5119
public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
whenFalse, bool hasErrors = false)
5133
public
BoundDecisionDagNode
WhenTrue { get; }
5134
public
BoundDecisionDagNode
WhenFalse { get; }
5139
public BoundTestDecisionDagNode Update(BoundDagTest test,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
whenFalse)
5153
public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
? whenFalse, bool hasErrors = false)
5168
public
BoundDecisionDagNode
WhenTrue { get; }
5169
public
BoundDecisionDagNode
? WhenFalse { get; }
5174
public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
? whenFalse)
11948
BoundDecisionDagNode
rootNode = (
BoundDecisionDagNode
)this.Visit(node.RootNode);
11954
BoundDecisionDagNode
next = (
BoundDecisionDagNode
)this.Visit(node.Next);
11960
BoundDecisionDagNode
whenTrue = (
BoundDecisionDagNode
)this.Visit(node.WhenTrue);
11961
BoundDecisionDagNode
whenFalse = (
BoundDecisionDagNode
)this.Visit(node.WhenFalse);
11967
BoundDecisionDagNode
whenTrue = (
BoundDecisionDagNode
)this.Visit(node.WhenTrue);
11968
BoundDecisionDagNode
? whenFalse = (
BoundDecisionDagNode
?)this.Visit(node.WhenFalse);
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (4)
57
BoundDecisionDagNode
node,
137
private static bool IsFailureNode(
BoundDecisionDagNode
node, LabelSymbol whenFalseLabel)
230
var
node = decisionDag.RootNode;
238
BoundDecisionDagNode
node,
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
46
protected override LabelSymbol GetDagNodeLabel(
BoundDecisionDagNode
dag)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (34)
43
private readonly PooledDictionary<
BoundDecisionDagNode
, LabelSymbol> _dagNodeLabels = PooledDictionary<
BoundDecisionDagNode
, LabelSymbol>.GetInstance();
65
var hasPredecessor = PooledHashSet<
BoundDecisionDagNode
>.GetInstance();
66
foreach (
BoundDecisionDagNode
node in decisionDag.TopologicallySortedNodes)
96
void notePredecessor(
BoundDecisionDagNode
successor)
111
protected virtual LabelSymbol GetDagNodeLabel(
BoundDecisionDagNode
dag)
373
ImmutableArray<
BoundDecisionDagNode
> sortedNodes = decisionDag.TopologicallySortedNodes;
374
var
firstNode = sortedNodes[0];
388
ImmutableArray<
BoundDecisionDagNode
> nodesToLower = sortedNodes.WhereAsArray(n => n.Kind != BoundKind.WhenDecisionDagNode && n.Kind != BoundKind.LeafDecisionDagNode);
389
var loweredNodes = PooledHashSet<
BoundDecisionDagNode
>.GetInstance();
392
BoundDecisionDagNode
node = nodesToLower[i];
418
BoundDecisionDagNode
nextNode = ((i + 1) < length) ? nodesToLower[i + 1] : null;
439
BoundDecisionDagNode
node,
440
HashSet<
BoundDecisionDagNode
> loweredNodes,
441
ImmutableArray<
BoundDecisionDagNode
> nodesToLower,
450
var
whenTrue = evaluationNode.Next;
451
var
whenFalse = testNode.WhenFalse;
457
var
nextNode =
471
private void GenerateTest(BoundExpression test,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
whenFalse,
BoundDecisionDagNode
nextNode)
498
private bool GenerateSwitchDispatch(
BoundDecisionDagNode
node, HashSet<
BoundDecisionDagNode
> loweredNodes)
509
bool canGenerateSwitchDispatch(
BoundDecisionDagNode
node)
550
BoundDecisionDagNode
node,
551
HashSet<
BoundDecisionDagNode
> loweredNodes,
559
BoundDecisionDagNode
node,
560
HashSet<
BoundDecisionDagNode
> loweredNodes,
978
private void LowerWhenClauses(ImmutableArray<
BoundDecisionDagNode
> sortedNodes)
1012
foreach (
BoundDecisionDagNode
node in sortedNodes)
1039
foreach (
BoundDecisionDagNode
node in sortedNodes)
1167
var
whenFalse = whenClause.WhenFalse;
1206
private void LowerDecisionDagNode(
BoundDecisionDagNode
node,
BoundDecisionDagNode
nextNode)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (6)
569
foreach (
BoundDecisionDagNode
node in decisionDag.TopologicallySortedNodes)
613
static bool usesOriginalInput(
BoundDecisionDagNode
node)
690
static
BoundDecisionDagNode
makeReplacement(
BoundDecisionDagNode
node, IReadOnlyDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
> replacement)