1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
2112
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);
794
PooledDictionary<
DagState
,
DagState
> uniqueState = s_uniqueStatePool.Allocate();
870
Dictionary<
DagState
,
DagState
> uniqueState)
875
using var workList = TemporaryArray<
DagState
>.Empty;
883
DagState
uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
885
var
state =
DagState
.GetInstance(cases, remainingValues);
886
if (uniqueState.TryGetValue(state, out
DagState
? existingState))
940
var
initialState = uniquifyState(new
948
DagState
state = workList.RemoveLast();
1011
static DecisionDag removeUnnecessaryStates(
DagState
initialState, DecisionDag result)
1017
if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> states))
1021
var stateToIndex = PooledDictionary<
DagState
, int>.GetInstance();
1028
DagState
state = states[i];
1030
DagState
? trueBranch = state.TrueBranch;
1031
DagState
? falseBranch = state.FalseBranch;
1182
/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="
DagState
"/> of the given <see cref="DecisionDag"/>
1183
/// and store it in <see cref="
DagState
.Dag"/>.
1191
bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> sortedStates);
1215
var
state = sortedStates[i];
1281
DagState
state,
1296
DagState
state,
1417
private FrozenArrayBuilder<StateForCase> RemoveEvaluation(
DagState
state, BoundDagEvaluation e)
1886
public readonly
DagState
RootNode;
1887
public DecisionDag(
DagState
rootNode)
1895
private static void AddSuccessor(ref TemporaryArray<
DagState
> builder,
DagState
state)
1904
/// <param name="result">Topologically sorted <see cref="
DagState
"/> nodes.</param>
1906
public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> result)
1923
var stateIdentifierMap = PooledDictionary<
DagState
, int>.GetInstance();
1946
foreach (
DagState
state in allStates)
2112
private static readonly ObjectPool<
DagState
> s_dagStatePool = new ObjectPool<
DagState
>(static () => new DagState());
2137
public
DagState
? TrueBranch, FalseBranch;
2147
/// Created an instance of <see cref="
DagState
"/>. Will take ownership of <paramref name="cases"/>. That
2151
public static
DagState
GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
2153
var
dagState = s_dagStatePool.Allocate();
2209
private sealed class DagStateEquivalence : IEqualityComparer<
DagState
>
2215
public bool Equals(
DagState
? x,
DagState
? y)
2234
public int GetHashCode(
DagState
x)
2338
DagState
state,
2375
protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e);
2377
public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e)
2382
protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
2481
DagState
state,
2491
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
2505
DagState
state,
2515
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
2532
DagState
state,
2632
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
2691
public static Tests RemoveEvaluation(One tests, DecisionDagBuilder builder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition)
2827
private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition)
3011
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3026
DagState
state,
3053
DagState
state,
3132
protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)