5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13211return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 13240return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 13263return new LocalState(variables.Id, container, CreateBitVector(reachable)); 13269return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 13469return new LocalState(Id, container, _state.Clone());
141 references to LocalState
Microsoft.CodeAnalysis.CSharp (141)
FlowAnalysis\NullableWalker.cs (119)
27: LocalDataFlowPass<NullableWalker.LocalState, NullableWalker.LocalFunctionState> 123public readonly Optional<LocalState> StateForLambda; 139public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 272/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 661void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 740void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1077private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1127void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1139void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1155private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1164private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1295private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1341private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1354private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1363bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1401private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1704Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1825var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1878Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1895Optional<LocalState> initialState, 1989private NullableFlowState GetState(ref LocalState state, int slot) 1998private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 2007private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 2012protected override void Normalize(ref LocalState state) 2020private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2828private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2834var tryState = NonMonotonicState.Value; 2843protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2845var tryState = other.GetStateForVariables(self.Id); 2939protected override LocalState TopState() 2941var state = LocalState.ReachableState(_variables); 2946protected override LocalState UnreachableState() 2948return LocalState.UnreachableState(_variables); 2951protected override LocalState ReachableBottomState() 2954return LocalState.ReachableStateWithNotNulls(_variables); 2987var parameterDefaultsNotAssignedState = State.Clone(); 3112var joinedState = this.StateWhenTrue.Clone(); 3343var state = TopState(); 3369var startingState = localFunctionState.StartingState; 3412LocalState state, 3438var oldState = this.State; 3515void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3542var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3656var currentState = State; 4687private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5187var stateAfterLeft = this.State; 5190var stateWhenNotNull = this.State; 5246LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5248LocalState stateWhenNotNull; 5284var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5617ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5623protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5728private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5736private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5759private void LearnFromNonNullTest(int slot, ref LocalState state) 5764private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5782private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5802private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5883var leftState = this.State.Clone(); 6102var savedState = this.State.Clone(); 6211var consequenceState = this.StateWhenTrue; 6212var alternativeState = this.StateWhenFalse; 6337BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6384LocalState consequenceState, 6385LocalState alternativeState, 6405(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6418(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6441LocalState state, 7721void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7734void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8158var originalWhenFalse = StateWhenFalse.Clone(); 8164var newWhenTrue = State.Clone(); 8326private static VariableState GetVariableState(Variables variables, LocalState localState) 9043var savedState = this.State.Clone(); 9426Optional<LocalState> stateForLambda = default, 10508var stateForLambda = this.State.Clone(); 10520private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 12290var leftTrue = this.StateWhenTrue; 12291var leftFalse = this.StateWhenFalse; 12307var leftTrue = this.StateWhenTrue; 12308var leftFalse = this.StateWhenFalse; 12320var rightState = State.Clone(); 12337var leftState = isAnd ? leftFalse : leftTrue; 12374protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 12469LocalState stateWhenNotNull; 12961protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 13077protected override string Dump(LocalState state) 13082protected override bool Meet(ref LocalState self, ref LocalState other) 13099protected override bool Join(ref LocalState self, ref LocalState other) 13136private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13143var state = conditionalState.StateWhenTrue.Clone(); 13185internal LocalState Value; 13187internal Boxed(LocalState value) 13208internal static LocalState Create(LocalStateSnapshot snapshot) 13223public static LocalState ReachableState(Variables variables) 13228public static LocalState UnreachableState(Variables variables) 13233public static LocalState ReachableStateWithNotNulls(Variables variables) 13257private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 13266public LocalState CreateNestedMethodState(Variables variables) 13295bool hasVariableCore(ref LocalState state, int id, int index) 13313static bool hasValue(ref LocalState state, int slot) 13323static bool hasValueCore(ref LocalState state, int id, int index) 13452internal LocalState GetStateForVariables(int id) 13454var state = this; 13466public LocalState Clone() 13472public bool Join(in LocalState other) 13501public bool Meet(in LocalState other) 13592public LocalState StartingState; 13594public LocalFunctionState(LocalState unreachableState) 13606return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)
FlowAnalysis\NullableWalker_Patterns.cs (21)
37var currentState = State; 273protected override LocalState VisitSwitchStatementDispatch(BoundSwitchStatement node) 311var afterSwitchState = labelStateMap.TryGetValue(node.BreakLabel, out var stateAndReachable) ? stateAndReachable.state : UnreachableState(); 339public LocalState State; 340public LocalState StateWhenTrue; 341public LocalState StateWhenFalse; 344public PossiblyConditionalState(LocalState stateWhenTrue, LocalState stateWhenFalse) 352public PossiblyConditionalState(LocalState state) 374private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 416var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 731void learnFromNonNullTest(int inputSlot, ref LocalState state) 806void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 895var endState = UnreachableState(); 989PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1003var armState = getStateForArm(arm, labelStateMap); 1034PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1046LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap) 1063var trueState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenFalseLabel : node.WhenTrueLabel, out var s1) ? s1.state : UnreachableState(); 1064var falseState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenTrueLabel : node.WhenFalseLabel, out var s2) ? s2.state : UnreachableState();