3 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (3)
FlowAnalysis\NullableWalker.cs (3)
12098return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 12121return new LocalState(variables.Id, container, CreateBitVector(reachable)); 12127return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true));
131 references to LocalState
Microsoft.CodeAnalysis.CSharp (131)
FlowAnalysis\NullableWalker.cs (112)
27: LocalDataFlowPass<NullableWalker.LocalState, NullableWalker.LocalFunctionState> 104public readonly Optional<LocalState> StateForLambda; 120public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 247/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 622void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 703void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 790void enforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 836void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 848void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 863void reportMemberIfBadConditionalState(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 872bool memberHasBadState(Symbol member, LocalState state) 1178private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1218private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1231private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1240bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1278private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1578Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1695var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1743Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1760Optional<LocalState> initialState, 1854private NullableFlowState GetState(ref LocalState state, int slot) 1863private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 1872private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 1877protected override void Normalize(ref LocalState state) 1885private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2650private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2656var tryState = NonMonotonicState.Value; 2665protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2667var tryState = other.GetStateForVariables(self.Id); 2721protected override LocalState TopState() 2723var state = LocalState.ReachableState(_variables); 2728protected override LocalState UnreachableState() 2730return LocalState.UnreachableState(_variables); 2733protected override LocalState ReachableBottomState() 2736return LocalState.ReachableStateWithNotNulls(_variables); 2769var parameterDefaultsNotAssignedState = State.Clone(); 2894var joinedState = this.StateWhenTrue.Clone(); 3125var state = TopState(); 3151var startingState = localFunctionState.StartingState; 3194LocalState state, 3220var oldState = this.State; 3290var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3406var currentState = State; 4297private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 4796var stateAfterLeft = this.State; 4799var stateWhenNotNull = this.State; 4855LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 4857LocalState stateWhenNotNull; 4893var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5169ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5175protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5280private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5288private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5311private void LearnFromNonNullTest(int slot, ref LocalState state) 5316private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5334private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5354private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5435var leftState = this.State.Clone(); 5653var savedState = this.State.Clone(); 5762var consequenceState = this.StateWhenTrue; 5763var alternativeState = this.StateWhenFalse; 5888BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 5935LocalState consequenceState, 5936LocalState alternativeState, 5956(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 5969(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 5992LocalState state, 7022void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7035void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 7453var originalWhenFalse = StateWhenFalse.Clone(); 7459var newWhenTrue = State.Clone(); 7621private static VariableState GetVariableState(Variables variables, LocalState localState) 8251var savedState = this.State.Clone(); 8633Optional<LocalState> stateForLambda = default, 9685var stateForLambda = this.State.Clone(); 9697private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 11168protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 11327LocalState stateWhenNotNull; 11819protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 11935protected override string Dump(LocalState state) 11940protected override bool Meet(ref LocalState self, ref LocalState other) 11957protected override bool Join(ref LocalState self, ref LocalState other) 11994private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 12001var state = conditionalState.StateWhenTrue.Clone(); 12043internal LocalState Value; 12045internal Boxed(LocalState value) 12066internal static LocalState Create(LocalStateSnapshot snapshot) 12081public static LocalState ReachableState(Variables variables) 12086public static LocalState UnreachableState(Variables variables) 12091public static LocalState ReachableStateWithNotNulls(Variables variables) 12115private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 12124public LocalState CreateNestedMethodState(Variables variables) 12153bool hasVariableCore(ref LocalState state, int id, int index) 12171static bool hasValue(ref LocalState state, int slot) 12181static bool hasValueCore(ref LocalState state, int id, int index) 12310internal LocalState GetStateForVariables(int id) 12312var state = this; 12324public LocalState Clone() 12330public bool Join(in LocalState other) 12359public bool Meet(in LocalState other) 12450public LocalState StartingState; 12452public LocalFunctionState(LocalState unreachableState) 12464return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)
FlowAnalysis\NullableWalker_Patterns.cs (18)
37var currentState = State; 235protected override LocalState VisitSwitchStatementDispatch(BoundSwitchStatement node) 301public LocalState State; 302public LocalState StateWhenTrue; 303public LocalState StateWhenFalse; 306public PossiblyConditionalState(LocalState stateWhenTrue, LocalState stateWhenFalse) 314public PossiblyConditionalState(LocalState state) 336private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 378var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 691void learnFromNonNullTest(int inputSlot, ref LocalState state) 766void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 855var endState = UnreachableState(); 949PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 963var armState = getStateForArm(arm, labelStateMap); 994PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1006LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap)