1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
2967
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);
1184
PooledDictionary<
DagState
,
DagState
> uniqueState = s_uniqueStatePool.Allocate();
1260
Dictionary<
DagState
,
DagState
> uniqueState)
1265
using var workList = TemporaryArray<
DagState
>.Empty;
1273
DagState
uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
1275
var
state =
DagState
.GetInstance(cases, remainingValues);
1276
if (uniqueState.TryGetValue(state, out
DagState
? existingState))
1330
var
initialState = uniquifyState(new
1338
DagState
state = workList.RemoveLast();
1401
static DecisionDag removeUnnecessaryStates(
DagState
initialState, DecisionDag result)
1407
if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> states))
1411
var stateToIndex = PooledDictionary<
DagState
, int>.GetInstance();
1418
DagState
state = states[i];
1420
DagState
? trueBranch = state.TrueBranch;
1421
DagState
? falseBranch = state.FalseBranch;
1572
/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="
DagState
"/> of the given <see cref="DecisionDag"/>
1573
/// and store it in <see cref="
DagState
.Dag"/>.
1581
bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> sortedStates);
1605
var
state = sortedStates[i];
1671
DagState
state,
1686
DagState
state,
1889
private FrozenArrayBuilder<StateForCase> RemoveEvaluation(
DagState
state, BoundDagEvaluation e)
2727
public readonly
DagState
RootNode;
2728
public DecisionDag(
DagState
rootNode)
2736
private static void AddSuccessor(ref TemporaryArray<
DagState
> builder,
DagState
state)
2745
/// <param name="result">Topologically sorted <see cref="
DagState
"/> nodes.</param>
2747
public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> result)
2764
var stateIdentifierMap = PooledDictionary<
DagState
, int>.GetInstance();
2801
foreach (
DagState
state in allStates)
2967
private static readonly ObjectPool<
DagState
> s_dagStatePool = new ObjectPool<
DagState
>(static () => new DagState());
2992
public
DagState
? TrueBranch, FalseBranch;
3002
/// Created an instance of <see cref="
DagState
"/>. Will take ownership of <paramref name="cases"/>. That
3006
public static
DagState
GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
3008
var
dagState = s_dagStatePool.Allocate();
3064
private sealed class DagStateEquivalence : IEqualityComparer<
DagState
>
3070
public bool Equals(
DagState
? x,
DagState
? y)
3089
public int GetHashCode(
DagState
x)
3193
DagState
state,
3230
protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e);
3232
public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e)
3237
protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3336
DagState
state,
3346
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3360
DagState
state,
3370
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3387
DagState
state,
3517
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3591
public static Tests RemoveEvaluation(One tests, DecisionDagBuilder builder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition)
3787
private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition)
3976
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3991
DagState
state,
4018
DagState
state,
4097
protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)