5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13862return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 13891return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 13914return new LocalState(variables.Id, container, CreateBitVector(reachable)); 13920return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 14120return 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;)"/>. 662void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 741void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1079private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1129void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1141void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1157private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1166private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1297private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1343private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1356private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1365bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1403private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1706Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1827var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1880Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1897Optional<LocalState> initialState, 1991private NullableFlowState GetState(ref LocalState state, int slot) 2000private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 2009private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 2014protected override void Normalize(ref LocalState state) 2022private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2830private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2836var tryState = NonMonotonicState.Value; 2845protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2847var tryState = other.GetStateForVariables(self.Id); 2941protected override LocalState TopState() 2943var state = LocalState.ReachableState(_variables); 2948protected override LocalState UnreachableState() 2950return LocalState.UnreachableState(_variables); 2953protected override LocalState ReachableBottomState() 2956return LocalState.ReachableStateWithNotNulls(_variables); 2989var parameterDefaultsNotAssignedState = State.Clone(); 3114var joinedState = this.StateWhenTrue.Clone(); 3345var state = TopState(); 3371var startingState = localFunctionState.StartingState; 3414LocalState state, 3440var oldState = this.State; 3517void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3544var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3685var currentState = State; 4917private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5417var stateAfterLeft = this.State; 5420var stateWhenNotNull = this.State; 5476LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5478LocalState stateWhenNotNull; 5514var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5847ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5853protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5958private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5966private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5989private void LearnFromNonNullTest(int slot, ref LocalState state) 5994private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 6012private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 6032private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 6113var leftState = this.State.Clone(); 6334var savedState = this.State.Clone(); 6443var consequenceState = this.StateWhenTrue; 6444var alternativeState = this.StateWhenFalse; 6569BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6616LocalState consequenceState, 6617LocalState alternativeState, 6637(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6650(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6673LocalState state, 7970void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7983void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8011LocalState markMemberAsNotNull(int receiverSlot, ref LocalState state, Symbol member) 8414var originalWhenFalse = StateWhenFalse.Clone(); 8420var newWhenTrue = State.Clone(); 8607private static VariableState GetVariableState(Variables variables, LocalState localState) 9335var savedState = this.State.Clone(); 9777Optional<LocalState> stateForLambda = default, 11074var stateForLambda = this.State.Clone(); 11086private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 12890var leftTrue = this.StateWhenTrue; 12891var leftFalse = this.StateWhenFalse; 12907var leftTrue = this.StateWhenTrue; 12908var leftFalse = this.StateWhenFalse; 12920var rightState = State.Clone(); 12937var leftState = isAnd ? leftFalse : leftTrue; 12974protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 13067LocalState stateWhenNotNull; 13728protected override string Dump(LocalState state) 13733protected override bool Meet(ref LocalState self, ref LocalState other) 13750protected override bool Join(ref LocalState self, ref LocalState other) 13787private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13794var state = conditionalState.StateWhenTrue.Clone(); 13836internal LocalState Value; 13838internal Boxed(LocalState value) 13859internal static LocalState Create(LocalStateSnapshot snapshot) 13874public static LocalState ReachableState(Variables variables) 13879public static LocalState UnreachableState(Variables variables) 13884public static LocalState ReachableStateWithNotNulls(Variables variables) 13908private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 13917public LocalState CreateNestedMethodState(Variables variables) 13946bool hasVariableCore(ref LocalState state, int id, int index) 13964static bool hasValue(ref LocalState state, int slot) 13974static bool hasValueCore(ref LocalState state, int id, int index) 14103internal LocalState GetStateForVariables(int id) 14105var state = this; 14117public LocalState Clone() 14123public bool Join(in LocalState other) 14152public bool Meet(in LocalState other) 14243public LocalState StartingState; 14245public LocalFunctionState(LocalState unreachableState) 14257return 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( 417var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 838void learnFromNonNullTest(int inputSlot, ref LocalState state) 913void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable) 993var endState = UnreachableState(); 1087PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1101var armState = getStateForArm(arm, labelStateMap); 1132PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1144LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap) 1161var trueState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenFalseLabel : node.WhenTrueLabel, out var s1) ? s1.state : UnreachableState(); 1162var falseState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenTrueLabel : node.WhenFalseLabel, out var s2) ? s2.state : UnreachableState();