1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
3022
private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new
DagState
());
68 references to DagState
Microsoft.CodeAnalysis.CSharp (68)
Binder\DecisionDagBuilder.cs (68)
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);
1217
PooledDictionary<
DagState
,
DagState
> uniqueState = s_uniqueStatePool.Allocate();
1293
Dictionary<
DagState
,
DagState
> uniqueState)
1298
using var workList = TemporaryArray<
DagState
>.Empty;
1306
DagState
uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
1308
var
state =
DagState
.GetInstance(cases, remainingValues);
1309
if (uniqueState.TryGetValue(state, out
DagState
? existingState))
1363
var
initialState = uniquifyState(new
1371
DagState
state = workList.RemoveLast();
1434
static DecisionDag removeUnnecessaryStates(
DagState
initialState, DecisionDag result)
1440
if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> states))
1444
var stateToIndex = PooledDictionary<
DagState
, int>.GetInstance();
1451
DagState
state = states[i];
1453
DagState
? trueBranch = state.TrueBranch;
1454
DagState
? falseBranch = state.FalseBranch;
1605
/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="
DagState
"/> of the given <see cref="DecisionDag"/>
1606
/// and store it in <see cref="
DagState
.Dag"/>.
1614
bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> sortedStates);
1638
var
state = sortedStates[i];
1704
DagState
state,
1719
DagState
state,
1922
private FrozenArrayBuilder<StateForCase> RemoveEvaluation(
DagState
state, BoundDagEvaluation e)
2782
public readonly
DagState
RootNode;
2783
public DecisionDag(
DagState
rootNode)
2791
private static void AddSuccessor(ref TemporaryArray<
DagState
> builder,
DagState
state)
2800
/// <param name="result">Topologically sorted <see cref="
DagState
"/> nodes.</param>
2802
public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> result)
2819
var stateIdentifierMap = PooledDictionary<
DagState
, int>.GetInstance();
2856
foreach (
DagState
state in allStates)
3022
private static readonly ObjectPool<
DagState
> s_dagStatePool = new ObjectPool<
DagState
>(static () => new DagState());
3047
public
DagState
? TrueBranch, FalseBranch;
3057
/// Created an instance of <see cref="
DagState
"/>. Will take ownership of <paramref name="cases"/>. That
3061
public static
DagState
GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
3063
var
dagState = s_dagStatePool.Allocate();
3119
private sealed class DagStateEquivalence : IEqualityComparer<
DagState
>
3125
public bool Equals(
DagState
? x,
DagState
? y)
3144
public int GetHashCode(
DagState
x)
3250
DagState
state,
3287
protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e);
3289
public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e)
3294
protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3393
DagState
state,
3403
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3417
DagState
state,
3427
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3444
DagState
state,
3574
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3658
static Tests removeEvaluation(One tests, DecisionDagBuilder builder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition)
3697
DagState
state,
3867
private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition)
4055
DagState
state,
4156
DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings,
4209
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
4224
DagState
state,
4251
DagState
state,
4330
protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)