1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
3023
private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new
DagState
());
66 references to DagState
Microsoft.CodeAnalysis.CSharp (66)
Binder\DecisionDagBuilder.cs (66)
42
/// the initial state in a <see cref="
DagState
"/>, and then for each such state description we decide what the test
44
/// represented by a <see cref="
DagState
"/> is a collection of partially matched cases represented by <see
45
/// cref="StateForCase"/>. When we have computed <see cref="
DagState
"/> descriptions for all of the states, we
55
private static readonly ObjectPool<PooledDictionary<
DagState
,
DagState
>> s_uniqueStatePool =
56
PooledDictionary<
DagState
,
DagState
>.CreatePool(DagStateEquivalence.Instance);
1218
PooledDictionary<
DagState
,
DagState
> uniqueState = s_uniqueStatePool.Allocate();
1294
Dictionary<
DagState
,
DagState
> uniqueState)
1299
using var workList = TemporaryArray<
DagState
>.Empty;
1307
DagState
uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
1309
var
state =
DagState
.GetInstance(cases, remainingValues);
1310
if (uniqueState.TryGetValue(state, out
DagState
? existingState))
1364
var
initialState = uniquifyState(new
1372
DagState
state = workList.RemoveLast();
1435
static DecisionDag removeUnnecessaryStates(
DagState
initialState, DecisionDag result)
1441
if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> states))
1445
var stateToIndex = PooledDictionary<
DagState
, int>.GetInstance();
1452
DagState
state = states[i];
1454
DagState
? trueBranch = state.TrueBranch;
1455
DagState
? falseBranch = state.FalseBranch;
1606
/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="
DagState
"/> of the given <see cref="DecisionDag"/>
1607
/// and store it in <see cref="
DagState
.Dag"/>.
1615
bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> sortedStates);
1639
var
state = sortedStates[i];
1705
DagState
state,
1720
DagState
state,
1923
private FrozenArrayBuilder<StateForCase> RemoveEvaluation(
DagState
state, BoundDagEvaluation e)
2783
public readonly
DagState
RootNode;
2784
public DecisionDag(
DagState
rootNode)
2792
private static void AddSuccessor(ref TemporaryArray<
DagState
> builder,
DagState
state)
2801
/// <param name="result">Topologically sorted <see cref="
DagState
"/> nodes.</param>
2803
public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<
DagState
> result)
3023
private static readonly ObjectPool<
DagState
> s_dagStatePool = new ObjectPool<
DagState
>(static () => new DagState());
3048
public
DagState
? TrueBranch, FalseBranch;
3058
/// Created an instance of <see cref="
DagState
"/>. Will take ownership of <paramref name="cases"/>. That
3062
public static
DagState
GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues)
3064
var
dagState = s_dagStatePool.Allocate();
3120
private sealed class DagStateEquivalence : IEqualityComparer<
DagState
>
3126
public bool Equals(
DagState
? x,
DagState
? y)
3145
public int GetHashCode(
DagState
x)
3251
DagState
state,
3288
protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e);
3290
public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e)
3295
protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3394
DagState
state,
3404
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3418
DagState
state,
3428
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3445
DagState
state,
3575
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
3659
static Tests removeEvaluation(One tests, DecisionDagBuilder builder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition)
3698
DagState
state,
3868
private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder,
DagState
state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition)
4056
DagState
state,
4157
DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings,
4210
protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)
4225
DagState
state,
4252
DagState
state,
4331
protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder,
DagState
state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)