125 writes to State
Microsoft.CodeAnalysis.CSharp (125)
FlowAnalysis\AbstractFlowPass.cs (31)
133State = default(TLocalState); 143State = newState; 443this.State = initialState.HasValue ? initialState.Value : TopState(); 547this.State = UnreachableState(); 699Join(ref this.State, ref previousState); 711if (Join(ref oldState, ref this.State)) 742JoinPendingBranches(ref this.State, continueLabel); 1238Join(ref this.State, ref shortCircuitState); 1424this.State = savedState; 1458Join(ref State, ref localFunctionState.StateFromBottom); 1462Meet(ref State, ref localFunctionState.StateFromTop); 1857Join(ref this.State, ref trueState); 1885Join(ref endState, ref this.State); 1931Meet(ref endState, ref this.State); 1944Meet(ref stateToUpdate, ref this.State); 2667Meet(ref stateWhenNotNull, ref State); 2792Join(ref State, ref shortCircuitState); 2827Join(ref shortCircuitState, ref State); 3043Join(ref this.State, ref savedState); 3174Join(ref savedState, ref State); 3181State = savedState; 3182Join(ref State, ref stateWhenNotNull); 3201Join(ref this.State, ref savedState); 3207Join(ref this.State, ref savedState); 3223Join(ref this.State, ref savedState); 3227Join(ref this.State, ref savedState); 3366Join(ref this.State, ref afterConsequenceWhenTrue); 3428Join(ref this.State, ref state); 3701this.State = savedState; 3828Join(ref this.State, ref leftState); 3920Join(ref this.State, ref afterBlock);
FlowAnalysis\AbstractFlowPass_LocalFunctions.cs (4)
83this.State = this.TopState(); 122this.State = pending.State; 131Join(ref stateAtReturn, ref this.State); 149this.State = savedState;
FlowAnalysis\AbstractFlowPass_Switch.cs (2)
31Join(ref afterSwitchState, ref this.State); 178Join(ref endState, ref this.State);
FlowAnalysis\AbstractRegionControlFlowPass.cs (5)
35this.State = TopState(); 41Join(ref finalState, ref this.State); 44this.State = returnBranch.State; 45Join(ref finalState, ref this.State); 48this.State = finalState;
FlowAnalysis\AlwaysAssignedWalker.cs (1)
117this.State = TopState();
FlowAnalysis\DataFlowsInWalker.cs (1)
74this.State = ResetState(this.State);
FlowAnalysis\DefiniteAssignment.cs (14)
189State = new LocalState(BitVector.Empty); 208State = new LocalState(BitVector.Empty); 230State = new LocalState(BitVector.Empty); 393this.State = returnBranch.State; 397Join(ref savedState, ref this.State); 400this.State = savedState; 1114if (slot >= this.State.Assigned.Capacity) Normalize(ref this.State); 1710SetSlotAssigned(slot, ref this.State); 1751SetSlotUnassigned(slot, ref this.State); 2392this.State = this.State.Reachable ? this.State.Clone() : ReachableBottomState(); 2402Join(ref stateAfterLambda, ref this.State); // a no-op except in region analysis 2405this.State = pending.State; 2416Join(ref stateAfterLambda, ref this.State); // a no-op except in region analysis 2419this.State = stateAfterLambda;
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (1)
79Normalize(ref this.State);
FlowAnalysis\LocalDataFlowPass.cs (1)
142Normalize(ref this.State);
FlowAnalysis\NullableWalker.cs (56)
880SetState(ref this.State, memberSlot, type.Type.IsPossiblyNullableReferenceTypeTypeParameter() ? NullableFlowState.MaybeDefault : NullableFlowState.MaybeNull); 1207SetState(ref this.State, memberSlot, NullableFlowState.MaybeNull); 2460LearnFromNonNullTest(value, ref State); 2663SetStateAndTrackForFinally(ref this.State, targetSlot, newState); 2777GetState(ref this.State, valueMemberSlot) : 2781SetStateAndTrackForFinally(ref this.State, targetMemberSlot, value); 2875SetStateAndTrackForFinally(ref this.State, slot, GetDefaultState(symbol)); 2998Join(ref State, ref parameterDefaultsNotAssignedState); 3013SetState(ref this.State, slot, state); 3442this.State = state.CreateNestedMethodState(_variables); 3505this.State = oldState; 3658SetState(ref this.State, slot, GetDefaultState(ref this.State, slot)); 4411SetState(ref this.State, slot, resultState); 4463operandState = GetState(ref this.State, operandSlot); 4474SetState(ref this.State, iUnionValuePropertySlot, operandState); 4734if (!initializer.Type.IsValueType && GetState(ref State, slot).MayBeNull()) 5762LearnFromNonNullTest(operand, ref State); 6115LearnFromNullTest(leftOperand, ref this.State); 6127SetState(ref this.State, leftSlot, NullableFlowState.NotNull); 6137Join(ref this.State, ref leftState); 6164LearnFromNullTest(leftOperand, ref this.State); 6365Join(ref savedState, ref State); 6391LearnFromNonNullTest(slot, ref State); 6397Join(ref this.State, ref savedState); 6418LearnFromNonNullTest(slot, ref State); 6462Join(ref this.State, ref consequenceState); 7937applyMemberPostConditions(receiverSlot, type, notNullMembers, ref State); 8201LearnFromNonNullTest(argumentNoConversion, ref State); 8532LearnFromNullTest(argument, ref State); 8538LearnFromNonNullTest(argument, ref State); 9079NullableFlowState state = GetState(ref this.State, slot); 9361SetState(ref this.State, slot, NullableFlowState.NotNull); 9502SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 9519SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 9546SetState(ref this.State, targetFieldSlot, convertedType.State); 9563valueFieldType = TypeWithState.Create(valueFieldType.Type, GetState(ref this.State, valueFieldSlot)); 9578SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9599SetState(ref this.State, targetFieldSlot, convertedType.State); 9604SetState(ref this.State, valueFieldSlot, GetState(ref this.State, conversionOperandSlot)); 9939LearnFromNonNullTest(conversionOperand, ref State); 10052LearnFromNonNullTest(conversionOperand, ref State); 10466LearnFromNonNullTest(conversionOperand, ref State); 10625LearnFromNonNullTest(conversionOperand, ref State); 10946LearnFromNonNullTest(arg, ref State); 11694SetResultType(node, TypeWithState.Create(results[0].RValueType.Type, GetState(ref State, extensionReceiverSlot))); 11883SetResultType(node, TypeWithState.Create(results[0].RValueType.Type, GetState(ref State, extensionReceiverSlot))); 12226var state = GetState(ref this.State, slot); 12599SetState(ref this.State, slot, state); 13048SetState(ref this.State, slot, NullableFlowState.NotNull); 13254SetState(ref this.State, memberSlot, 13255node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13365LearnFromNonNullTest(receiverOpt, ref this.State); 13569SetState(ref this.State, slot, NullableFlowState.NotNull); 13783Join(ref State, ref other.State);
FlowAnalysis\NullableWalker_Patterns.cs (9)
172LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 185LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 192LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 462SetState(ref State, outputSlot, NullableFlowState.NotNull); 514SetState(ref this.State, outputSlot, NullableFlowState.NotNull); // Slice value is assumed to be never null 522var inputState = GetState(ref this.State, inputSlot); 627var tempState = GetState(ref this.State, tempSlot); 904Join(ref this.State, ref stateAndReachable.state.State); 1037Join(ref endState, ref this.State);
144 references to State
Microsoft.CodeAnalysis.CSharp (144)
FlowAnalysis\AbstractFlowPass.cs (54)
150SetConditionalState(State, State.Clone()); 229: Dump(this.State); 637SetConditionalState(this.State, UnreachableState()); 642SetConditionalState(UnreachableState(), this.State); 702_loopHeadState[node] = this.State.Clone(); 986? (State, stateWhenNotNull) 987: (stateWhenNotNull, State)); 1013SetConditionalState(UnreachableState(), this.State); 1018SetConditionalState(this.State, UnreachableState()); 1231TLocalState? shortCircuitState = hasConditionalEvaluation ? State.Clone() : default; 1389savedState = this.State.Clone(); 1833trueState = this.State; 1873var initialState = this.State.Clone(); 1880var endState = this.State; 2074PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 2383PendingBranches.Add(new PendingBranch(node, this.State, null)); 2672? (State, stateWhenNotNull) 2673: (stateWhenNotNull, State)); 2727? (State, stateWhenNotNull) 2728: (stateWhenNotNull, State)); 2783TLocalState? shortCircuitState = hasConditionalEvaluation ? State.Clone() : default; 2817shortCircuitState = State.Clone(); 2875PendingBranches.Add(new PendingBranch(node, this.State, null)); 2930bodyState = this.State; 2952var breakState = this.State.Clone(); 2961PendingBranches.Add(new PendingBranch(node, this.State, null)); 2987SetConditionalState(stateWhenNotNull, State); 3028savedState = State.Clone(); 3128stateWhenNotNull = this.State.Clone(); 3144stateWhenNotNull = this.State.Clone(); 3149var savedState = this.State.Clone(); 3180stateWhenNotNull = State; 3198var savedState = this.State.Clone(); 3205savedState = this.State.Clone(); 3220var savedState = this.State.Clone(); 3225savedState = this.State.Clone(); 3307PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3315PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3360var (afterConsequenceWhenTrue, afterConsequenceWhenFalse) = conditionalAfterConsequence ? (StateWhenTrue, StateWhenFalse) : (State, State); 3418PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3429_labels[label] = this.State.Clone(); 3484PendingBranches.Add(new PendingBranch(node, this.State, null)); 3515PendingBranches.Add(new PendingBranch(node, this.State, null)); 3523PendingBranches.Add(new PendingBranch(node, this.State, null)); 3550var savedState = this.State; 3696TLocalState savedState = savedState = this.State.Clone(); 3812var savedState = this.State.Clone(); 3814leftState = this.State.Clone(); 3821var savedState = this.State.Clone(); 3823leftState = this.State.Clone(); 3914TLocalState initialState = this.State.Clone(); 3916TLocalState afterBlock = this.State;
FlowAnalysis\AbstractFlowPass_LocalFunctions.cs (3)
82var savedState = this.State; 106PendingBranches.Add(new PendingBranch(null, this.State, null)); 119var stateAtReturn = this.State;
FlowAnalysis\AbstractFlowPass_Switch.cs (4)
44TLocalState initialState = this.State.Clone(); 69PendingBranches.Add(new PendingBranch(label, this.State, label.Label)); 134var state = this.State.Clone(); 158var dispatchState = this.State;
FlowAnalysis\AbstractRegionControlFlowPass.cs (1)
34LocalState finalState = this.State;
FlowAnalysis\AlwaysAssignedWalker.cs (1)
132_endOfRegionState = this.State.Clone();
FlowAnalysis\ControlFlowPass.cs (6)
108return new LocalState(false, this.State.Reported); 200return State.Alive; 262if (!this.State.Alive && 263!this.State.Reported && 269this.State.Reported = true; 377if (this.State.Alive)
FlowAnalysis\DataFlowsInWalker.cs (1)
74this.State = ResetState(this.State);
FlowAnalysis\DataFlowsOutWalker.cs (3)
82if (slot > 0 && !this.State.IsAssigned(slot)) 94if (this.State.Reachable && IsInside) 217if (State.Reachable)
FlowAnalysis\DefiniteAssignment.cs (21)
390var savedState = this.State; 419if (Diagnostics != null && this.State.Reachable) 432if (!this.State.IsAssigned(thisSlot)) 443if (fieldSlot == -1 || !this.State.IsAssigned(fieldSlot)) 1111if (this.State.Reachable) 1114if (slot >= this.State.Assigned.Capacity) Normalize(ref this.State); 1115if (slot > 0 && !this.State.IsAssigned(slot)) 1225if (slot == -1 || !State.IsAssigned(slot)) 1323if (this.State.Reachable && !IsAssigned(expr, out int unassignedSlot)) 1428return this.State.IsAssigned(unassignedSlot); 1503SetSlotState(slot, assigned: written || !this.State.Reachable); 1516SetSlotState(slot, assigned: written || !this.State.Reachable); 1900if (!this.State.Reachable) 1925if (slot > 0 && !this.State.IsAssigned(slot)) 1936LocalState result = this.State.Clone(); 1950SetConditionalState(this.State, whenFail); 2390LocalState stateAfterLambda = this.State; 2392this.State = this.State.Reachable ? this.State.Clone() : ReachableBottomState(); 2549if (!this.State.Reachable) return; 2695if (this.State.Reachable && !IsAssigned(node, out unassignedSlot))
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (4)
75if (this.State.Reachable) 77if (slot >= this.State.Assigned.Capacity) 82if (slot > 0 && !this.State.IsAssigned(slot)) 114if (fieldSlot > 0 && !State.IsAssigned(fieldSlot))
FlowAnalysis\DefinitelyAssignedWalker.cs (1)
81this.ProcessState(definitelyAssigned, this.State, state2opt: null);
FlowAnalysis\NullableWalker.cs (36)
525return $"{{{GetType().Name} {Dump(State)}{"}"}"; 637_snapshotBuilderOpt?.TakeIncrementalSnapshot(methodMainNode, State); 644enforceMemberNotNull(syntaxOpt: null, this.State); 645EnforceParameterNotNullOnExit(syntaxOpt: null, this.State); 1884finalNullableState = GetVariableState(walker._variables, walker.State); 1952_snapshotBuilderOpt?.TakeIncrementalSnapshot(node, State); 2650if (this.State.Reachable) 2989var parameterDefaultsNotAssignedState = State.Clone(); 3069PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 3120PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 3127EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 3440var oldState = this.State; 3465PendingBranches.Add(new PendingBranch(null, this.State, null)); 3472enforceMemberNotNull(((LocalFunctionSymbol)lambdaOrFunctionSymbol).Syntax, this.State); 3474EnforceParameterNotNullOnExit(null, this.State); 3544var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3685var currentState = State; 5417var stateAfterLeft = this.State; 5420var stateWhenNotNull = this.State; 5433? (State, stateWhenNotNull) 5434: (stateWhenNotNull, State)); 5517? (State, stateWhenNotNull) 5518: (stateWhenNotNull, State)); 6113var leftState = this.State.Clone(); 6334var savedState = this.State.Clone(); 6460consequenceState = this.State; 6712=> this.IsConditionalState ? (this.StateWhenTrue.Reachable || this.StateWhenFalse.Reachable) : this.State.Reachable; 8420var newWhenTrue = State.Clone(); 8426SetConditionalState(newWhenTrue, whenFalse: State); 9335var savedState = this.State.Clone(); 11074var stateForLambda = this.State.Clone(); 11100initialState.HasValue ? initialState.Value : State.Clone(), 11725if (this.State.Reachable) 12920var rightState = State.Clone(); 13080SetConditionalState(stateWhenNotNull, State); 13350if (receiverOpt != null && this.State.Reachable)
FlowAnalysis\NullableWalker_Patterns.cs (6)
37var currentState = State; 307PendingBranches.Add(new PendingBranch(label, this.State, label.Label)); 363: new PossiblyConditionalState(nullableWalker.State); 614labelStateMap.Add(d.Label, (this.State, nodeBelievedReachable)); 662gotoNode(w.WhenTrue, this.State, nodeBelievedReachable); 1025if (!State.Reachable && arm.WhenClause != null)
FlowAnalysis\RegionReachableWalker.cs (3)
27endPointIsReachable = badRegion || walker._regionEndPointIsReachable.GetValueOrDefault(walker.State.Alive); 46_regionStartPointIsReachable = this.State.Alive; 52_regionEndPointIsReachable = this.State.Alive;