3 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (3)
FlowAnalysis\NullableWalker.cs (3)
12343return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 12366return new LocalState(variables.Id, container, CreateBitVector(reachable)); 12372return 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) 247/// 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;)"/>. 623void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 704void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1041private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1091void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1103void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1119private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1128private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1252private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1292private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1305private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1314bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1352private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1652Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1769var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1817Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1834Optional<LocalState> initialState, 1928private NullableFlowState GetState(ref LocalState state, int slot) 1937private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 1946private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 1951protected override void Normalize(ref LocalState state) 1959private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2748private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2754var tryState = NonMonotonicState.Value; 2763protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2765var tryState = other.GetStateForVariables(self.Id); 2819protected override LocalState TopState() 2821var state = LocalState.ReachableState(_variables); 2826protected override LocalState UnreachableState() 2828return LocalState.UnreachableState(_variables); 2831protected override LocalState ReachableBottomState() 2834return LocalState.ReachableStateWithNotNulls(_variables); 2867var parameterDefaultsNotAssignedState = State.Clone(); 2992var joinedState = this.StateWhenTrue.Clone(); 3223var state = TopState(); 3249var startingState = localFunctionState.StartingState; 3292LocalState state, 3318var oldState = this.State; 3395void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3422var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3538var currentState = State; 4474private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 4973var stateAfterLeft = this.State; 4976var stateWhenNotNull = this.State; 5032LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5034LocalState stateWhenNotNull; 5070var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5346ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5352protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5457private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5465private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5488private void LearnFromNonNullTest(int slot, ref LocalState state) 5493private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5511private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5531private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5612var leftState = this.State.Clone(); 5830var savedState = this.State.Clone(); 5939var consequenceState = this.StateWhenTrue; 5940var alternativeState = this.StateWhenFalse; 6065BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6112LocalState consequenceState, 6113LocalState alternativeState, 6133(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6146(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6169LocalState state, 7231void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7244void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 7668var originalWhenFalse = StateWhenFalse.Clone(); 7674var newWhenTrue = State.Clone(); 7836private static VariableState GetVariableState(Variables variables, LocalState localState) 8467var savedState = this.State.Clone(); 8850Optional<LocalState> stateForLambda = default, 9912var stateForLambda = this.State.Clone(); 9924private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 11413protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 11572LocalState stateWhenNotNull; 12064protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 12180protected override string Dump(LocalState state) 12185protected override bool Meet(ref LocalState self, ref LocalState other) 12202protected override bool Join(ref LocalState self, ref LocalState other) 12239private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 12246var state = conditionalState.StateWhenTrue.Clone(); 12288internal LocalState Value; 12290internal Boxed(LocalState value) 12311internal static LocalState Create(LocalStateSnapshot snapshot) 12326public static LocalState ReachableState(Variables variables) 12331public static LocalState UnreachableState(Variables variables) 12336public static LocalState ReachableStateWithNotNulls(Variables variables) 12360private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 12369public LocalState CreateNestedMethodState(Variables variables) 12398bool hasVariableCore(ref LocalState state, int id, int index) 12416static bool hasValue(ref LocalState state, int slot) 12426static bool hasValueCore(ref LocalState state, int id, int index) 12555internal LocalState GetStateForVariables(int id) 12557var state = this; 12569public LocalState Clone() 12575public bool Join(in LocalState other) 12604public bool Meet(in LocalState other) 12695public LocalState StartingState; 12697public LocalFunctionState(LocalState unreachableState) 12709return 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)