4 types derived from BoundDecisionDagNode
Microsoft.CodeAnalysis.CSharp (4)
Generated\BoundNodes.xml.Generated.cs (4)
5045
internal sealed partial class BoundEvaluationDecisionDagNode :
BoundDecisionDagNode
5076
internal sealed partial class BoundTestDecisionDagNode :
BoundDecisionDagNode
5110
internal sealed partial class BoundWhenDecisionDagNode :
BoundDecisionDagNode
5145
internal 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
754
var
rootDecisionDagNode = decisionDag.RootNode.Dag;
776
var
node = sortedBoundDagNodes[i];
997
var uniqueNodes = PooledDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
>.GetInstance();
998
BoundDecisionDagNode
uniqifyDagNode(
BoundDecisionDagNode
node) => uniqueNodes.GetOrAdd(node, node);
1026
BoundDecisionDagNode
whenTrue = finalState(first.Syntax, first.CaseLabel, default);
1027
BoundDecisionDagNode
? whenFalse = state.FalseBranch.Dag;
1033
BoundDecisionDagNode
finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings)
1035
BoundDecisionDagNode
final = uniqifyDagNode(new BoundLeafDecisionDagNode(syntax, label));
1045
BoundDecisionDagNode
? next = state.TrueBranch!.Dag;
1053
BoundDecisionDagNode
? whenTrue = state.TrueBranch!.Dag;
1054
BoundDecisionDagNode
? whenFalse = state.FalseBranch!.Dag;
1872
public
BoundDecisionDagNode
? Dag;
Binder\PatternExplainer.cs (23)
31
private static ImmutableArray<
BoundDecisionDagNode
> ShortestPathToNode(
32
ImmutableArray<
BoundDecisionDagNode
> nodes,
33
BoundDecisionDagNode
node,
38
var dist = PooledDictionary<
BoundDecisionDagNode
, (int distance,
BoundDecisionDagNode
next)>.GetInstance();
41
int distance(
BoundDecisionDagNode
x)
53
var
n = nodes[i];
73
var result = ArrayBuilder<
BoundDecisionDagNode
>.GetInstance(capacity: distanceToNode);
74
for (
BoundDecisionDagNode
n = nodes[0]; n != node;)
83
(int d,
BoundDecisionDagNode
next) = dist[t];
110
private static void VisitPathsToNode(
BoundDecisionDagNode
rootNode,
BoundDecisionDagNode
targetNode, bool nullPaths,
111
Func<ImmutableArray<
BoundDecisionDagNode
>, bool, bool> handler)
113
var pathBuilder = ArrayBuilder<
BoundDecisionDagNode
>.GetInstance();
120
bool exploreToNode(
BoundDecisionDagNode
currentNode, bool currentRequiresFalseWhenClause)
181
ImmutableArray<
BoundDecisionDagNode
> nodes,
182
BoundDecisionDagNode
targetNode,
210
static string samplePatternFromOtherPaths(BoundDagTemp rootIdentifier,
BoundDecisionDagNode
rootNode,
211
BoundDecisionDagNode
targetNode, bool nullPaths, out bool requiresFalseWhenClause, out bool unnamedEnumValue)
244
static void gatherConstraintsAndEvaluations(
BoundDecisionDagNode
targetNode, ImmutableArray<
BoundDecisionDagNode
> pathToNode,
252
BoundDecisionDagNode
node = pathToNode[i];
257
BoundDecisionDagNode
nextNode = (i < n - 1) ? pathToNode[i + 1] : targetNode;
Binder\SwitchExpressionBinder.cs (2)
111
static void addNonNullSuccessors(ref TemporaryArray<
BoundDecisionDagNode
> builder,
BoundDecisionDagNode
n)
BoundTree\BoundDecisionDag.cs (27)
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);
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)
220
foreach (
var
state in allStates)
FlowAnalysis\NullableWalker_Patterns.cs (5)
413
var nodeStateMap = PooledDictionary<
BoundDecisionDagNode
, (PossiblyConditionalState state, bool believedReachable)>.GetInstance();
418
foreach (
var
dagNode in decisionDag.TopologicallySortedNodes)
772
void gotoNodeWithCurrentState(
BoundDecisionDagNode
node, bool believedReachable)
804
void gotoNode(
BoundDecisionDagNode
node, LocalState state, bool believedReachable)
901
var
leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Generated\BoundNodes.xml.Generated.cs (30)
5005
public BoundDecisionDag(SyntaxNode syntax,
BoundDecisionDagNode
rootNode, bool hasErrors = false)
5014
public
BoundDecisionDagNode
RootNode { get; }
5019
public BoundDecisionDag Update(
BoundDecisionDagNode
rootNode)
5047
public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation,
BoundDecisionDagNode
next, bool hasErrors = false)
5059
public
BoundDecisionDagNode
Next { get; }
5064
public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation,
BoundDecisionDagNode
next)
5078
public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
whenFalse, bool hasErrors = false)
5092
public
BoundDecisionDagNode
WhenTrue { get; }
5093
public
BoundDecisionDagNode
WhenFalse { get; }
5098
public BoundTestDecisionDagNode Update(BoundDagTest test,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
whenFalse)
5112
public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
? whenFalse, bool hasErrors = false)
5127
public
BoundDecisionDagNode
WhenTrue { get; }
5128
public
BoundDecisionDagNode
? WhenFalse { get; }
5133
public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression,
BoundDecisionDagNode
whenTrue,
BoundDecisionDagNode
? whenFalse)
11546
BoundDecisionDagNode
rootNode = (
BoundDecisionDagNode
)this.Visit(node.RootNode);
11552
BoundDecisionDagNode
next = (
BoundDecisionDagNode
)this.Visit(node.Next);
11558
BoundDecisionDagNode
whenTrue = (
BoundDecisionDagNode
)this.Visit(node.WhenTrue);
11559
BoundDecisionDagNode
whenFalse = (
BoundDecisionDagNode
)this.Visit(node.WhenFalse);
11565
BoundDecisionDagNode
whenTrue = (
BoundDecisionDagNode
)this.Visit(node.WhenTrue);
11566
BoundDecisionDagNode
? whenFalse = (
BoundDecisionDagNode
?)this.Visit(node.WhenFalse);
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,
970
private void LowerWhenClauses(ImmutableArray<
BoundDecisionDagNode
> sortedNodes)
1004
foreach (
BoundDecisionDagNode
node in sortedNodes)
1031
foreach (
BoundDecisionDagNode
node in sortedNodes)
1159
var
whenFalse = whenClause.WhenFalse;
1198
private void LowerDecisionDagNode(
BoundDecisionDagNode
node,
BoundDecisionDagNode
nextNode)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (6)
534
foreach (
BoundDecisionDagNode
node in decisionDag.TopologicallySortedNodes)
578
static bool usesOriginalInput(
BoundDecisionDagNode
node)
655
static
BoundDecisionDagNode
makeReplacement(
BoundDecisionDagNode
node, IReadOnlyDictionary<
BoundDecisionDagNode
,
BoundDecisionDagNode
> replacement)
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)
40
protected override LabelSymbol GetDagNodeLabel(
BoundDecisionDagNode
dag)