31 references to StateMachineState
Microsoft.CodeAnalysis (26)
CodeGen\StateMachineStateDebugInfo.cs (11)
12internal readonly struct StateMachineStateDebugInfo(int syntaxOffset, AwaitDebugId awaitId, StateMachineState stateNumber) 16public readonly StateMachineState StateNumber = stateNumber; 34public readonly StateMachineState? FirstUnusedIncreasingStateMachineState; 43public readonly StateMachineState? FirstUnusedDecreasingStateMachineState; 45private StateMachineStatesDebugInfo(ImmutableArray<StateMachineStateDebugInfo> states, StateMachineState? firstUnusedIncreasingStateMachineState, StateMachineState? firstUnusedDecreasingStateMachineState) 54StateMachineState? firstUnusedIncreasingStateMachineState = null, firstUnusedDecreasingStateMachineState = null; 67var maxState = stateInfos.Max(info => info.StateNumber) + 1; 68var minState = stateInfos.Min(info => info.StateNumber) - 1; 70firstUnusedIncreasingStateMachineState = (firstUnusedIncreasingStateMachineState != null) ? (StateMachineState)Math.Max((int)firstUnusedIncreasingStateMachineState.Value, (int)maxState) : maxState; 74firstUnusedDecreasingStateMachineState = (firstUnusedDecreasingStateMachineState != null) ? (StateMachineState)Math.Min((int)firstUnusedDecreasingStateMachineState.Value, (int)minState) : minState;
CodeGen\VariableSlotAllocator.cs (2)
106public abstract StateMachineState? GetFirstUnusedStateMachineState(bool increasing); 116public abstract bool TryGetPreviousStateMachineState(SyntaxNode syntax, AwaitDebugId awaitId, out StateMachineState state);
Emit\EditAndContinue\DefinitionMap.cs (4)
232IReadOnlyDictionary<(int syntaxOffset, AwaitDebugId debugId), StateMachineState>? stateMachineStateMap = null; 233StateMachineState? firstUnusedIncreasingStateMachineState = null; 234StateMachineState? firstUnusedDecreasingStateMachineState = null; 486private static IReadOnlyDictionary<(int syntaxOffset, AwaitDebugId debugId), StateMachineState>? MakeStateMachineStateMap(ImmutableArray<StateMachineStateDebugInfo> debugInfos)
Emit\EditAndContinue\EncVariableSlotAllocator.cs (8)
37private readonly IReadOnlyDictionary<(int syntaxOffset, AwaitDebugId awaitId), StateMachineState>? _stateMachineStateMap; 38private readonly StateMachineState? _firstUnusedDecreasingStateMachineState; 39private readonly StateMachineState? _firstUnusedIncreasingStateMachineState; 59IReadOnlyDictionary<(int syntaxOffset, AwaitDebugId awaitId), StateMachineState>? stateMachineStateMap, 60StateMachineState? firstUnusedIncreasingStateMachineState, 61StateMachineState? firstUnusedDecreasingStateMachineState, 358public override StateMachineState? GetFirstUnusedStateMachineState(bool increasing) 361public override bool TryGetPreviousStateMachineState(SyntaxNode syntax, AwaitDebugId awaitId, out StateMachineState state)
Emit\EditAndContinueMethodDebugInformation.cs (1)
349mapBuilder.Add(new StateMachineStateDebugInfo(syntaxOffset, new AwaitDebugId((byte)relativeOrdinal), (StateMachineState)stateNumber));
Microsoft.CodeAnalysis.CSharp (5)
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (1)
43/// States for `yield return` are decreasing from <see cref="StateMachineState.InitialAsyncIteratorState"/>.
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (1)
203var initialState = _isEnumerable ? StateMachineState.FinishedState : StateMachineState.InitialAsyncIteratorState;
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (1)
473if (slotAllocator?.TryGetPreviousStateMachineState(syntax, awaitId: default, out var finalizeState) != true)
Lowering\IteratorRewriter\IteratorRewriter.cs (1)
305var initialState = _isEnumerable ? StateMachineState.FinishedState : StateMachineState.InitialIteratorState;
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
56if (_slotAllocator?.TryGetPreviousStateMachineState(awaitOrYieldReturnSyntax, awaitId, out var state) == true)