1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
3014
private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new
DagState
());
65 references to DagState
Microsoft.CodeAnalysis.CSharp (65)
Binder\DecisionDagBuilder.cs (65)
41
/// the initial state in a <see cref="
DagState
"/>, and then for each such state description we decide what the test
43
/// represented by a <see cref="
DagState
"/> is a collection of partially matched cases represented by <see
44
/// cref="StateForCase"/>. When we have computed <see cref="
DagState
"/> descriptions for all of the states, we
54
private static readonly ObjectPool<PooledDictionary<
DagState
,
DagState
>> s_uniqueStatePool =
55
PooledDictionary<
DagState
,
DagState
>.CreatePool(DagStateEquivalence.Instance);
1209
PooledDictionary<
DagState
,
DagState
> uniqueState = s_uniqueStatePool.Allocate();
1285
Dictionary<
DagState
,
DagState
> uniqueState)
1290
using var workList = TemporaryArray<
DagState
>.Empty;
1298
DagState
uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
1300
var
state =
DagState
.GetInstance(cases, remainingValues);
1301
if (uniqueState.TryGetValue(state, out
DagState
? existingState))
1355
var
initialState = uniquifyState(new
1363
DagState
state = workList.RemoveLast();
1426
static DecisionDag removeUnnecessaryStates(
DagState
initialState, DecisionDag result)
1432
if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> states))
1436
var stateToIndex = PooledDictionary<
DagState
, int>.GetInstance();
1443
DagState
state = states[i];
1445
DagState
? trueBranch = state.TrueBranch;
1446
DagState
? falseBranch = state.FalseBranch;
1597
/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="
DagState
"/> of the given <see cref="DecisionDag"/>
1598
/// and store it in <see cref="
DagState
.Dag"/>.
1606
bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> sortedStates);
1630
var
state = sortedStates[i];
1696
DagState
state,
1711
DagState
state,
1914
private FrozenArrayBuilder<StateForCase> RemoveEvaluation(
DagState
state, BoundDagEvaluation e)
2774
public readonly
DagState
RootNode;
2775
public DecisionDag(
DagState
rootNode)
2783
private static void AddSuccessor(ref TemporaryArray<
DagState
> builder,
DagState
state)
2792
/// <param name="result">Topologically sorted <see cref="
DagState
"/> nodes.</param>
2794
public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> result)
2811
var stateIdentifierMap = PooledDictionary<
DagState
, int>.GetInstance();
2848
foreach (
DagState
state in allStates)
3014
private static readonly ObjectPool<
DagState
> s_dagStatePool = new ObjectPool<
DagState
>(static () => new DagState());
3039
public
DagState
? TrueBranch, FalseBranch;
3049
/// Created an instance of <see cref="
DagState
"/>. Will take ownership of <paramref name="cases"/>. That
3053
public static
DagState
GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
3055
var
dagState = s_dagStatePool.Allocate();
3111
private sealed class DagStateEquivalence : IEqualityComparer<
DagState
>
3117
public bool Equals(
DagState
? x,
DagState
? y)
3136
public int GetHashCode(
DagState
x)
3240
DagState
state,
3277
protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e);
3279
public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e)
3284
protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3383
DagState
state,
3393
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3407
DagState
state,
3417
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3434
DagState
state,
3564
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3638
public static Tests RemoveEvaluation(One tests, DecisionDagBuilder builder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition)
3834
private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition)
4023
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
4038
DagState
state,
4065
DagState
state,
4144
protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)