1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
3014private 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); 1209PooledDictionary<DagState, DagState> uniqueState = s_uniqueStatePool.Allocate(); 1285Dictionary<DagState, DagState> uniqueState) 1290using var workList = TemporaryArray<DagState>.Empty; 1298DagState uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 1300var state = DagState.GetInstance(cases, remainingValues); 1301if (uniqueState.TryGetValue(state, out DagState? existingState)) 1355var initialState = uniquifyState(new 1363DagState state = workList.RemoveLast(); 1426static DecisionDag removeUnnecessaryStates(DagState initialState, DecisionDag result) 1432if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> states)) 1436var stateToIndex = PooledDictionary<DagState, int>.GetInstance(); 1443DagState state = states[i]; 1445DagState? trueBranch = state.TrueBranch; 1446DagState? falseBranch = state.FalseBranch; 1597/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="DagState"/> of the given <see cref="DecisionDag"/> 1598/// and store it in <see cref="DagState.Dag"/>. 1606bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> sortedStates); 1630var state = sortedStates[i]; 1696DagState state, 1711DagState state, 1914private FrozenArrayBuilder<StateForCase> RemoveEvaluation(DagState state, BoundDagEvaluation e) 2774public readonly DagState RootNode; 2775public DecisionDag(DagState rootNode) 2783private static void AddSuccessor(ref TemporaryArray<DagState> builder, DagState state) 2792/// <param name="result">Topologically sorted <see cref="DagState"/> nodes.</param> 2794public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> result) 2811var stateIdentifierMap = PooledDictionary<DagState, int>.GetInstance(); 2848foreach (DagState state in allStates) 3014private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new DagState()); 3039public DagState? TrueBranch, FalseBranch; 3049/// Created an instance of <see cref="DagState"/>. Will take ownership of <paramref name="cases"/>. That 3053public static DagState GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 3055var dagState = s_dagStatePool.Allocate(); 3111private sealed class DagStateEquivalence : IEqualityComparer<DagState> 3117public bool Equals(DagState? x, DagState? y) 3136public int GetHashCode(DagState x) 3240DagState state, 3277protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e); 3279public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e) 3284protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3383DagState state, 3393protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3407DagState state, 3417protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3434DagState state, 3564protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3638public static Tests RemoveEvaluation(One tests, DecisionDagBuilder builder, DagState state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition) 3834private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder, DagState state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition) 4023protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 4038DagState state, 4065DagState state, 4144protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)