127 writes to State
Microsoft.CodeAnalysis.CSharp (127)
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\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); 1190Join(ref this.State, ref shortCircuitState); 1386this.State = savedState; 1420Join(ref State, ref localFunctionState.StateFromBottom); 1424Meet(ref State, ref localFunctionState.StateFromTop); 1819Join(ref this.State, ref trueState); 1847Join(ref endState, ref this.State); 1893Meet(ref endState, ref this.State); 1906Meet(ref stateToUpdate, ref this.State); 2629Meet(ref stateWhenNotNull, ref State); 2754Join(ref State, ref shortCircuitState); 2789Join(ref shortCircuitState, ref State); 3005Join(ref this.State, ref savedState); 3136Join(ref savedState, ref State); 3143State = savedState; 3144Join(ref State, ref stateWhenNotNull); 3163Join(ref this.State, ref savedState); 3169Join(ref this.State, ref savedState); 3185Join(ref this.State, ref savedState); 3189Join(ref this.State, ref savedState); 3328Join(ref this.State, ref afterConsequenceWhenTrue); 3390Join(ref this.State, ref state); 3672this.State = savedState; 3799Join(ref this.State, ref leftState); 3891Join(ref this.State, ref afterBlock);
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 (16)
194State = new LocalState(BitVector.Empty); 213State = new LocalState(BitVector.Empty); 235State = new LocalState(BitVector.Empty); 399this.State = returnBranch.State; 403Join(ref savedState, ref this.State); 406this.State = savedState; 1123if (slot >= this.State.Assigned.Capacity) Normalize(ref this.State); 1719SetSlotAssigned(slot, ref this.State); 1760SetSlotUnassigned(slot, ref this.State); 2388Meet(ref whenTrue, ref State); 2389Meet(ref whenFalse, ref State); 2433this.State = this.State.Reachable ? this.State.Clone() : ReachableBottomState(); 2443Join(ref stateAfterLambda, ref this.State); // a no-op except in region analysis 2446this.State = pending.State; 2457Join(ref stateAfterLambda, ref this.State); // a no-op except in region analysis 2460this.State = stateAfterLambda;
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (1)
79Normalize(ref this.State);
FlowAnalysis\LocalDataFlowPass.cs (1)
143Normalize(ref this.State);
FlowAnalysis\NullableWalker_Patterns.cs (9)
176LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 189LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 196LearnFromNullTest(inputSlot, inputType, ref this.State, markDependentSlotsNotNull: false); 466SetState(ref State, outputSlot, NullableFlowState.NotNull); 518SetState(ref this.State, outputSlot, NullableFlowState.NotNull); // Slice value is assumed to be never null 526var inputState = GetState(ref this.State, inputSlot); 631var tempState = GetState(ref this.State, tempSlot); 913Join(ref this.State, ref stateAndReachable.state.State); 1131Join(ref endState, ref this.State);
FlowAnalysis\NullableWalker.cs (56)
909SetState(ref this.State, memberSlot, type.Type.IsPossiblyNullableReferenceTypeTypeParameter() ? NullableFlowState.MaybeDefault : NullableFlowState.MaybeNull); 1261SetState(ref this.State, memberSlot, NullableFlowState.MaybeNull); 2533LearnFromNonNullTest(value, ref State); 2736SetStateAndTrackForFinally(ref this.State, targetSlot, newState); 2857GetState(ref this.State, valueMemberSlot) : 2861SetStateAndTrackForFinally(ref this.State, targetMemberSlot, value); 2955SetStateAndTrackForFinally(ref this.State, slot, GetDefaultState(targetSlot, symbol)); 3078Join(ref State, ref parameterDefaultsNotAssignedState); 3093SetState(ref this.State, slot, state); 3522this.State = state.CreateNestedMethodState(_variables); 3585this.State = oldState; 3738SetState(ref this.State, slot, GetDefaultState(ref this.State, slot)); 4494SetState(ref this.State, slot, resultState); 4558operandState = GetState(ref this.State, operandSlot); 4574SetState(ref this.State, iUnionValuePropertySlot, state); 4771if (!initializer.Type.IsValueType && GetState(ref State, slot).MayBeNull()) 5868LearnFromNonNullTest(operand, ref State); 6221LearnFromNullTest(leftOperand, ref this.State); 6233SetState(ref this.State, leftSlot, NullableFlowState.NotNull); 6243Join(ref this.State, ref leftState); 6270LearnFromNullTest(leftOperand, ref this.State); 6471Join(ref savedState, ref State); 6497LearnFromNonNullTest(slot, ref State); 6503Join(ref this.State, ref savedState); 6524LearnFromNonNullTest(slot, ref State); 6568Join(ref this.State, ref consequenceState); 8088applyMemberPostConditions(receiverSlot, type, notNullMembers, ref State); 8345LearnFromNonNullTest(argumentNoConversion, ref State); 8671LearnFromNullTest(argument, ref State); 8677LearnFromNonNullTest(argument, ref State); 9218NullableFlowState state = GetState(ref this.State, slot); 9500SetState(ref this.State, slot, NullableFlowState.NotNull); 9641SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 9658SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 9685SetState(ref this.State, targetFieldSlot, convertedType.State); 9702valueFieldType = TypeWithState.Create(valueFieldType.Type, GetState(ref this.State, valueFieldSlot)); 9717SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9737SetState(ref this.State, targetFieldSlot, convertedType.State); 9742SetState(ref this.State, valueFieldSlot, GetState(ref this.State, conversionOperandSlot)); 10076LearnFromNonNullTest(conversionOperand, ref State); 10189LearnFromNonNullTest(conversionOperand, ref State); 10603LearnFromNonNullTest(conversionOperand, ref State); 10772LearnFromNonNullTest(conversionOperand, ref State); 11104LearnFromNonNullTest(arg, ref State); 11859SetResultType(node, TypeWithState.Create(results[0].RValueType.Type, GetState(ref State, extensionReceiverSlot))); 12052SetResultType(node, TypeWithState.Create(results[0].RValueType.Type, GetState(ref State, extensionReceiverSlot))); 12435var state = GetState(ref this.State, slot); 12817SetState(ref this.State, slot, state); 13266SetState(ref this.State, slot, NullableFlowState.NotNull); 13472SetState(ref this.State, memberSlot, 13473node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13583LearnFromNonNullTest(receiverOpt, ref this.State); 13787SetState(ref this.State, slot, NullableFlowState.NotNull); 14010Join(ref State, ref other.State);
145 references to State
Microsoft.CodeAnalysis.CSharp (145)
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\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(); 938? (State, stateWhenNotNull) 939: (stateWhenNotNull, State)); 965SetConditionalState(UnreachableState(), this.State); 970SetConditionalState(this.State, UnreachableState()); 1183TLocalState? shortCircuitState = hasConditionalEvaluation ? State.Clone() : default; 1341savedState = this.State.Clone(); 1795trueState = this.State; 1835var initialState = this.State.Clone(); 1842var endState = this.State; 2036PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 2345PendingBranches.Add(new PendingBranch(node, this.State, null)); 2634? (State, stateWhenNotNull) 2635: (stateWhenNotNull, State)); 2689? (State, stateWhenNotNull) 2690: (stateWhenNotNull, State)); 2745TLocalState? shortCircuitState = hasConditionalEvaluation ? State.Clone() : default; 2779shortCircuitState = State.Clone(); 2837PendingBranches.Add(new PendingBranch(node, this.State, null)); 2892bodyState = this.State; 2914var breakState = this.State.Clone(); 2923PendingBranches.Add(new PendingBranch(node, this.State, null)); 2949SetConditionalState(stateWhenNotNull, State); 2990savedState = State.Clone(); 3090stateWhenNotNull = this.State.Clone(); 3106stateWhenNotNull = this.State.Clone(); 3111var savedState = this.State.Clone(); 3142stateWhenNotNull = State; 3160var savedState = this.State.Clone(); 3167savedState = this.State.Clone(); 3182var savedState = this.State.Clone(); 3187savedState = this.State.Clone(); 3269PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3277PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3322var (afterConsequenceWhenTrue, afterConsequenceWhenFalse) = conditionalAfterConsequence ? (StateWhenTrue, StateWhenFalse) : (State, State); 3380PendingBranches.Add(new PendingBranch(node, this.State, node.Label)); 3391_labels[label] = this.State.Clone(); 3446PendingBranches.Add(new PendingBranch(node, this.State, null)); 3477PendingBranches.Add(new PendingBranch(node, this.State, null)); 3485PendingBranches.Add(new PendingBranch(node, this.State, null)); 3512var savedState = this.State; 3667TLocalState savedState = savedState = this.State.Clone(); 3783var savedState = this.State.Clone(); 3785leftState = this.State.Clone(); 3792var savedState = this.State.Clone(); 3794leftState = this.State.Clone(); 3885TLocalState initialState = this.State.Clone(); 3887TLocalState afterBlock = 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; 267if (!this.State.Alive && 268!this.State.Reported && 274this.State.Reported = true; 396if (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 (22)
396var savedState = this.State; 425if (Diagnostics != null && this.State.Reachable) 438if (!this.State.IsAssigned(thisSlot)) 449if (fieldSlot == -1 || !this.State.IsAssigned(fieldSlot)) 1120if (this.State.Reachable) 1123if (slot >= this.State.Assigned.Capacity) Normalize(ref this.State); 1124if (slot > 0 && !this.State.IsAssigned(slot)) 1234if (slot == -1 || !State.IsAssigned(slot)) 1332if (this.State.Reachable && !IsAssigned(expr, out int unassignedSlot)) 1437return this.State.IsAssigned(unassignedSlot); 1512SetSlotState(slot, assigned: written || !this.State.Reachable); 1525SetSlotState(slot, assigned: written || !this.State.Reachable); 1909if (!this.State.Reachable) 1934if (slot > 0 && !this.State.IsAssigned(slot)) 1945LocalState result = this.State.Clone(); 1959SetConditionalState(this.State, whenFail); 2431LocalState stateAfterLambda = this.State; 2433this.State = this.State.Reachable ? this.State.Clone() : ReachableBottomState(); 2579this.State.Reachable && 2620if (!this.State.Reachable) return; 2766if (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_Patterns.cs (6)
39var currentState = State; 310PendingBranches.Add(new PendingBranch(label, this.State, label.Label)); 366: new PossiblyConditionalState(nullableWalker.State); 618labelStateMap.Add(d.Label, (this.State, nodeBelievedReachable)); 666gotoNode(w.WhenTrue, this.State, nodeBelievedReachable, from: w, whenTrueBranch: true); 1119if (!State.Reachable && arm.WhenClause != null)
FlowAnalysis\NullableWalker.cs (36)
542return $"{{{GetType().Name} {Dump(State)}{"}"}"; 656_snapshotBuilderOpt?.TakeIncrementalSnapshot(methodMainNode, State); 663enforceMemberNotNull(syntaxOpt: null, this.State); 664EnforceParameterNotNullOnExit(syntaxOpt: null, this.State); 1938finalNullableState = GetVariableState(walker._variables, walker.State); 2006_snapshotBuilderOpt?.TakeIncrementalSnapshot(node, State); 2723if (this.State.Reachable) 3069var parameterDefaultsNotAssignedState = State.Clone(); 3149PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 3200PendingBranches.Add(new PendingBranch(node, this.State, label: null)); 3207EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 3520var oldState = this.State; 3545PendingBranches.Add(new PendingBranch(null, this.State, null)); 3552enforceMemberNotNull(((LocalFunctionSymbol)lambdaOrFunctionSymbol).Syntax, this.State); 3554EnforceParameterNotNullOnExit(null, this.State); 3624var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3765var currentState = State; 5507var stateAfterLeft = this.State; 5510var stateWhenNotNull = this.State; 5523? (State, stateWhenNotNull) 5524: (stateWhenNotNull, State)); 5607? (State, stateWhenNotNull) 5608: (stateWhenNotNull, State)); 6219var leftState = this.State.Clone(); 6440var savedState = this.State.Clone(); 6566consequenceState = this.State; 6818=> this.IsConditionalState ? (this.StateWhenTrue.Reachable || this.StateWhenFalse.Reachable) : this.State.Reachable; 8565var newWhenTrue = State.Clone(); 8571SetConditionalState(newWhenTrue, whenFalse: State); 9474var savedState = this.State.Clone(); 11232var stateForLambda = this.State.Clone(); 11258initialState.HasValue ? initialState.Value : State.Clone(), 11890if (this.State.Reachable) 13138var rightState = State.Clone(); 13298SetConditionalState(stateWhenNotNull, State); 13568if (receiverOpt != null && this.State.Reachable)
FlowAnalysis\RegionReachableWalker.cs (3)
27endPointIsReachable = badRegion || walker._regionEndPointIsReachable.GetValueOrDefault(walker.State.Alive); 46_regionStartPointIsReachable = this.State.Alive; 52_regionEndPointIsReachable = this.State.Alive;