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