3 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (3)
FlowAnalysis\NullableWalker.cs (3)
12641return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 12664return new LocalState(variables.Id, container, CreateBitVector(reachable)); 12670return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true));
132 references to LocalState
Microsoft.CodeAnalysis.CSharp (132)
FlowAnalysis\NullableWalker.cs (113)
27: LocalDataFlowPass<NullableWalker.LocalState, NullableWalker.LocalFunctionState> 104public readonly Optional<LocalState> StateForLambda; 120public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 253/// 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;)"/>. 636void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 717void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1054private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1104void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1116void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1132private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1141private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1272private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1318private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1331private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1340bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1378private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1681Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1801var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1854Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1871Optional<LocalState> initialState, 1965private NullableFlowState GetState(ref LocalState state, int slot) 1974private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 1983private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 1988protected override void Normalize(ref LocalState state) 1996private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2804private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2810var tryState = NonMonotonicState.Value; 2819protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2821var tryState = other.GetStateForVariables(self.Id); 2915protected override LocalState TopState() 2917var state = LocalState.ReachableState(_variables); 2922protected override LocalState UnreachableState() 2924return LocalState.UnreachableState(_variables); 2927protected override LocalState ReachableBottomState() 2930return LocalState.ReachableStateWithNotNulls(_variables); 2963var parameterDefaultsNotAssignedState = State.Clone(); 3088var joinedState = this.StateWhenTrue.Clone(); 3320var state = TopState(); 3346var startingState = localFunctionState.StartingState; 3389LocalState state, 3415var oldState = this.State; 3492void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3519var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3635var currentState = State; 4575private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5075var stateAfterLeft = this.State; 5078var stateWhenNotNull = this.State; 5134LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5136LocalState stateWhenNotNull; 5172var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5443ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5449protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5554private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5562private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5585private void LearnFromNonNullTest(int slot, ref LocalState state) 5590private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5608private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5628private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5709var leftState = this.State.Clone(); 5928var savedState = this.State.Clone(); 6037var consequenceState = this.StateWhenTrue; 6038var alternativeState = this.StateWhenFalse; 6163BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6210LocalState consequenceState, 6211LocalState alternativeState, 6231(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6244(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6267LocalState state, 7458void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7471void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 7895var originalWhenFalse = StateWhenFalse.Clone(); 7901var newWhenTrue = State.Clone(); 8063private static VariableState GetVariableState(Variables variables, LocalState localState) 8702var savedState = this.State.Clone(); 9085Optional<LocalState> stateForLambda = default, 10159var stateForLambda = this.State.Clone(); 10171private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 11711protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 11870LocalState stateWhenNotNull; 12362protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 12478protected override string Dump(LocalState state) 12483protected override bool Meet(ref LocalState self, ref LocalState other) 12500protected override bool Join(ref LocalState self, ref LocalState other) 12537private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 12544var state = conditionalState.StateWhenTrue.Clone(); 12586internal LocalState Value; 12588internal Boxed(LocalState value) 12609internal static LocalState Create(LocalStateSnapshot snapshot) 12624public static LocalState ReachableState(Variables variables) 12629public static LocalState UnreachableState(Variables variables) 12634public static LocalState ReachableStateWithNotNulls(Variables variables) 12658private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 12667public LocalState CreateNestedMethodState(Variables variables) 12696bool hasVariableCore(ref LocalState state, int id, int index) 12714static bool hasValue(ref LocalState state, int slot) 12724static bool hasValueCore(ref LocalState state, int id, int index) 12853internal LocalState GetStateForVariables(int id) 12855var state = this; 12867public LocalState Clone() 12873public bool Join(in LocalState other) 12902public bool Meet(in LocalState other) 12993public LocalState StartingState; 12995public LocalFunctionState(LocalState unreachableState) 13007return 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; 273protected override LocalState VisitSwitchStatementDispatch(BoundSwitchStatement node) 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(); 729void learnFromNonNullTest(int inputSlot, ref LocalState state) 804void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 893var endState = UnreachableState(); 987PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1001var armState = getStateForArm(arm, labelStateMap); 1032PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1044LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap)