5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13073return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 13102return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 13125return new LocalState(variables.Id, container, CreateBitVector(reachable)); 13131return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 13331return new LocalState(Id, container, _state.Clone());
141 references to LocalState
Microsoft.CodeAnalysis.CSharp (141)
FlowAnalysis\NullableWalker.cs (119)
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;)"/>. 642void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 723void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1060private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1110void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1122void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1138private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1147private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1278private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1324private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1337private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1346bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1384private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1687Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1807var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1860Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1877Optional<LocalState> initialState, 1971private NullableFlowState GetState(ref LocalState state, int slot) 1980private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 1989private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 1994protected override void Normalize(ref LocalState state) 2002private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2810private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2816var tryState = NonMonotonicState.Value; 2825protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2827var tryState = other.GetStateForVariables(self.Id); 2921protected override LocalState TopState() 2923var state = LocalState.ReachableState(_variables); 2928protected override LocalState UnreachableState() 2930return LocalState.UnreachableState(_variables); 2933protected override LocalState ReachableBottomState() 2936return LocalState.ReachableStateWithNotNulls(_variables); 2969var parameterDefaultsNotAssignedState = State.Clone(); 3094var joinedState = this.StateWhenTrue.Clone(); 3326var state = TopState(); 3352var startingState = localFunctionState.StartingState; 3395LocalState state, 3421var oldState = this.State; 3498void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3525var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3641var currentState = State; 4636private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5136var stateAfterLeft = this.State; 5139var stateWhenNotNull = this.State; 5195LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5197LocalState stateWhenNotNull; 5233var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5566ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5572protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5677private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5685private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5708private void LearnFromNonNullTest(int slot, ref LocalState state) 5713private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5731private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5751private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5832var leftState = this.State.Clone(); 6051var savedState = this.State.Clone(); 6160var consequenceState = this.StateWhenTrue; 6161var alternativeState = this.StateWhenFalse; 6286BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6333LocalState consequenceState, 6334LocalState alternativeState, 6354(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6367(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6390LocalState state, 7629void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7642void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8066var originalWhenFalse = StateWhenFalse.Clone(); 8072var newWhenTrue = State.Clone(); 8234private static VariableState GetVariableState(Variables variables, LocalState localState) 8905var savedState = this.State.Clone(); 9288Optional<LocalState> stateForLambda = default, 10370var stateForLambda = this.State.Clone(); 10382private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 12152var leftTrue = this.StateWhenTrue; 12153var leftFalse = this.StateWhenFalse; 12169var leftTrue = this.StateWhenTrue; 12170var leftFalse = this.StateWhenFalse; 12182var rightState = State.Clone(); 12199var leftState = isAnd ? leftFalse : leftTrue; 12236protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 12331LocalState stateWhenNotNull; 12823protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 12939protected override string Dump(LocalState state) 12944protected override bool Meet(ref LocalState self, ref LocalState other) 12961protected override bool Join(ref LocalState self, ref LocalState other) 12998private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13005var state = conditionalState.StateWhenTrue.Clone(); 13047internal LocalState Value; 13049internal Boxed(LocalState value) 13070internal static LocalState Create(LocalStateSnapshot snapshot) 13085public static LocalState ReachableState(Variables variables) 13090public static LocalState UnreachableState(Variables variables) 13095public static LocalState ReachableStateWithNotNulls(Variables variables) 13119private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 13128public LocalState CreateNestedMethodState(Variables variables) 13157bool hasVariableCore(ref LocalState state, int id, int index) 13175static bool hasValue(ref LocalState state, int slot) 13185static bool hasValueCore(ref LocalState state, int id, int index) 13314internal LocalState GetStateForVariables(int id) 13316var state = this; 13328public LocalState Clone() 13334public bool Join(in LocalState other) 13363public bool Meet(in LocalState other) 13454public LocalState StartingState; 13456public LocalFunctionState(LocalState unreachableState) 13468return 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();