5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13918return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 13947return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 13970return new LocalState(variables.Id, container, CreateBitVector(reachable)); 13976return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 14176return new LocalState(Id, container, _state.Clone());
142 references to LocalState
Microsoft.CodeAnalysis.CSharp (142)
FlowAnalysis\NullableWalker.cs (120)
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, int, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 679void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 758void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1096private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1146void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1158void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1174private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1183private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1314private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1360private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1373private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1382bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1420private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1723Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1844var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1897Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1914Optional<LocalState> initialState, 2008private NullableFlowState GetState(ref LocalState state, int slot) 2017private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 2026private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 2031protected override void Normalize(ref LocalState state) 2039private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2866private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2872var tryState = NonMonotonicState.Value; 2881protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2883var tryState = other.GetStateForVariables(self.Id); 2977protected override LocalState TopState() 2979var state = LocalState.ReachableState(_variables); 2984protected override LocalState UnreachableState() 2986return LocalState.UnreachableState(_variables); 2989protected override LocalState ReachableBottomState() 2992return LocalState.ReachableStateWithNotNulls(_variables); 3025var parameterDefaultsNotAssignedState = State.Clone(); 3150var joinedState = this.StateWhenTrue.Clone(); 3381var state = TopState(); 3407var startingState = localFunctionState.StartingState; 3450LocalState state, 3476var oldState = this.State; 3553void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3580var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3721var currentState = State; 4957private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5457var stateAfterLeft = this.State; 5460var stateWhenNotNull = this.State; 5516LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5518LocalState stateWhenNotNull; 5554var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5887ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5893protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5998private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 6006private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 6029private void LearnFromNonNullTest(int slot, ref LocalState state) 6034private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 6052private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 6072private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 6153var leftState = this.State.Clone(); 6374var savedState = this.State.Clone(); 6483var consequenceState = this.StateWhenTrue; 6484var alternativeState = this.StateWhenFalse; 6609BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6656LocalState consequenceState, 6657LocalState alternativeState, 6677(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6690(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6713LocalState state, 8012void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 8025void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8053LocalState markMemberAsNotNull(int receiverSlot, ref LocalState state, Symbol member) 8457var originalWhenFalse = StateWhenFalse.Clone(); 8463var newWhenTrue = State.Clone(); 8644private static VariableState GetVariableState(Variables variables, LocalState localState) 9372var savedState = this.State.Clone(); 9813Optional<LocalState> stateForLambda = default, 11124var stateForLambda = this.State.Clone(); 11136private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 12945var leftTrue = this.StateWhenTrue; 12946var leftFalse = this.StateWhenFalse; 12962var leftTrue = this.StateWhenTrue; 12963var leftFalse = this.StateWhenFalse; 12975var rightState = State.Clone(); 12992var leftState = isAnd ? leftFalse : leftTrue; 13029protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 13122LocalState stateWhenNotNull; 13784protected override string Dump(LocalState state) 13789protected override bool Meet(ref LocalState self, ref LocalState other) 13806protected override bool Join(ref LocalState self, ref LocalState other) 13843private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13850var state = conditionalState.StateWhenTrue.Clone(); 13892internal LocalState Value; 13894internal Boxed(LocalState value) 13915internal static LocalState Create(LocalStateSnapshot snapshot) 13930public static LocalState ReachableState(Variables variables) 13935public static LocalState UnreachableState(Variables variables) 13940public static LocalState ReachableStateWithNotNulls(Variables variables) 13964private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 13973public LocalState CreateNestedMethodState(Variables variables) 14002bool hasVariableCore(ref LocalState state, int id, int index) 14020static bool hasValue(ref LocalState state, int slot) 14030static bool hasValueCore(ref LocalState state, int id, int index) 14159internal LocalState GetStateForVariables(int id) 14161var state = this; 14173public LocalState Clone() 14179public bool Join(in LocalState other) 14208public bool Meet(in LocalState other) 14299public LocalState StartingState; 14301public LocalFunctionState(LocalState unreachableState) 14313return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)
FlowAnalysis\NullableWalker_Patterns.cs (21)
38var currentState = State; 275protected override LocalState VisitSwitchStatementDispatch(BoundSwitchStatement node) 313var afterSwitchState = labelStateMap.TryGetValue(node.BreakLabel, out var stateAndReachable) ? stateAndReachable.state : UnreachableState(); 341public LocalState State; 342public LocalState StateWhenTrue; 343public LocalState StateWhenFalse; 346public PossiblyConditionalState(LocalState stateWhenTrue, LocalState stateWhenFalse) 354public PossiblyConditionalState(LocalState state) 376private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 419var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 840void learnFromNonNullTest(int inputSlot, ref LocalState state) 915void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 995var endState = UnreachableState(); 1089PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1103var armState = getStateForArm(arm, labelStateMap); 1134PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1146LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap) 1163var trueState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenFalseLabel : node.WhenTrueLabel, out var s1) ? s1.state : UnreachableState(); 1164var falseState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenTrueLabel : node.WhenFalseLabel, out var s2) ? s2.state : UnreachableState();