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