5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13174return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 13203return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 13226return new LocalState(variables.Id, container, CreateBitVector(reachable)); 13232return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 13432return new LocalState(Id, container, _state.Clone());
141 references to LocalState
Microsoft.CodeAnalysis.CSharp (141)
FlowAnalysis\NullableWalker.cs (119)
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, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 661void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 742void 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(); 3346var state = TopState(); 3372var startingState = localFunctionState.StartingState; 3415LocalState state, 3441var oldState = this.State; 3518void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3545var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3659var currentState = State; 4691private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5191var stateAfterLeft = this.State; 5194var stateWhenNotNull = this.State; 5250LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5252LocalState stateWhenNotNull; 5288var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5621ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5627protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5732private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 5740private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 5763private void LearnFromNonNullTest(int slot, ref LocalState state) 5768private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 5786private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 5806private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 5887var leftState = this.State.Clone(); 6106var savedState = this.State.Clone(); 6215var consequenceState = this.StateWhenTrue; 6216var alternativeState = this.StateWhenFalse; 6341BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6388LocalState consequenceState, 6389LocalState alternativeState, 6409(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6422(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6445LocalState state, 7684void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 7697void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8121var originalWhenFalse = StateWhenFalse.Clone(); 8127var newWhenTrue = State.Clone(); 8289private static VariableState GetVariableState(Variables variables, LocalState localState) 9006var savedState = this.State.Clone(); 9389Optional<LocalState> stateForLambda = default, 10471var stateForLambda = this.State.Clone(); 10483private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 12253var leftTrue = this.StateWhenTrue; 12254var leftFalse = this.StateWhenFalse; 12270var leftTrue = this.StateWhenTrue; 12271var leftFalse = this.StateWhenFalse; 12283var rightState = State.Clone(); 12300var leftState = isAnd ? leftFalse : leftTrue; 12337protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 12432LocalState stateWhenNotNull; 12924protected override void VisitCatchBlock(BoundCatchBlock node, ref LocalState finallyState) 13040protected override string Dump(LocalState state) 13045protected override bool Meet(ref LocalState self, ref LocalState other) 13062protected override bool Join(ref LocalState self, ref LocalState other) 13099private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13106var state = conditionalState.StateWhenTrue.Clone(); 13148internal LocalState Value; 13150internal Boxed(LocalState value) 13171internal static LocalState Create(LocalStateSnapshot snapshot) 13186public static LocalState ReachableState(Variables variables) 13191public static LocalState UnreachableState(Variables variables) 13196public static LocalState ReachableStateWithNotNulls(Variables variables) 13220private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 13229public LocalState CreateNestedMethodState(Variables variables) 13258bool hasVariableCore(ref LocalState state, int id, int index) 13276static bool hasValue(ref LocalState state, int slot) 13286static bool hasValueCore(ref LocalState state, int id, int index) 13415internal LocalState GetStateForVariables(int id) 13417var state = this; 13429public LocalState Clone() 13435public bool Join(in LocalState other) 13464public bool Meet(in LocalState other) 13555public LocalState StartingState; 13557public LocalFunctionState(LocalState unreachableState) 13569return 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();