5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
13986return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 14015return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 14038return new LocalState(variables.Id, container, CreateBitVector(reachable)); 14044return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 14244return 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;)"/>. 679void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 758void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1096private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1146void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1158void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1174private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1183private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1314private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1360private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1373private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1382bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1420private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1723Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1844var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1897Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1914Optional<LocalState> initialState, 2008private NullableFlowState GetState(ref LocalState state, int slot) 2017private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 2026private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 2031protected override void Normalize(ref LocalState state) 2039private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2875private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2881var tryState = NonMonotonicState.Value; 2890protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2892var tryState = other.GetStateForVariables(self.Id); 2986protected override LocalState TopState() 2988var state = LocalState.ReachableState(_variables); 2993protected override LocalState UnreachableState() 2995return LocalState.UnreachableState(_variables); 2998protected override LocalState ReachableBottomState() 3001return LocalState.ReachableStateWithNotNulls(_variables); 3034var parameterDefaultsNotAssignedState = State.Clone(); 3159var joinedState = this.StateWhenTrue.Clone(); 3390var state = TopState(); 3416var startingState = localFunctionState.StartingState; 3459LocalState state, 3485var oldState = this.State; 3562void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3589var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3730var currentState = State; 4955private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5455var stateAfterLeft = this.State; 5458var stateWhenNotNull = this.State; 5514LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5516LocalState stateWhenNotNull; 5552var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5885ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5891protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 5996private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 6004private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 6027private void LearnFromNonNullTest(int slot, ref LocalState state) 6032private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 6050private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 6070private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 6151var leftState = this.State.Clone(); 6372var savedState = this.State.Clone(); 6481var consequenceState = this.StateWhenTrue; 6482var alternativeState = this.StateWhenFalse; 6607BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6654LocalState consequenceState, 6655LocalState alternativeState, 6675(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6688(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6711LocalState state, 8039void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 8052void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8080LocalState markMemberAsNotNull(int receiverSlot, ref LocalState state, Symbol member) 8484var originalWhenFalse = StateWhenFalse.Clone(); 8490var newWhenTrue = State.Clone(); 8671private static VariableState GetVariableState(Variables variables, LocalState localState) 9399var savedState = this.State.Clone(); 9840Optional<LocalState> stateForLambda = default, 11153var stateForLambda = this.State.Clone(); 11165private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 13013var leftTrue = this.StateWhenTrue; 13014var leftFalse = this.StateWhenFalse; 13030var leftTrue = this.StateWhenTrue; 13031var leftFalse = this.StateWhenFalse; 13043var rightState = State.Clone(); 13060var leftState = isAnd ? leftFalse : leftTrue; 13097protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 13190LocalState stateWhenNotNull; 13852protected override string Dump(LocalState state) 13857protected override bool Meet(ref LocalState self, ref LocalState other) 13874protected override bool Join(ref LocalState self, ref LocalState other) 13911private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 13918var state = conditionalState.StateWhenTrue.Clone(); 13960internal LocalState Value; 13962internal Boxed(LocalState value) 13983internal static LocalState Create(LocalStateSnapshot snapshot) 13998public static LocalState ReachableState(Variables variables) 14003public static LocalState UnreachableState(Variables variables) 14008public static LocalState ReachableStateWithNotNulls(Variables variables) 14032private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 14041public LocalState CreateNestedMethodState(Variables variables) 14070bool hasVariableCore(ref LocalState state, int id, int index) 14088static bool hasValue(ref LocalState state, int slot) 14098static bool hasValueCore(ref LocalState state, int id, int index) 14227internal LocalState GetStateForVariables(int id) 14229var state = this; 14241public LocalState Clone() 14247public bool Join(in LocalState other) 14276public bool Meet(in LocalState other) 14367public LocalState StartingState; 14369public LocalFunctionState(LocalState unreachableState) 14381return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)
FlowAnalysis\NullableWalker_Patterns.cs (21)
39var currentState = State; 276protected override LocalState VisitSwitchStatementDispatch(BoundSwitchStatement node) 314var afterSwitchState = labelStateMap.TryGetValue(node.BreakLabel, out var stateAndReachable) ? stateAndReachable.state : UnreachableState(); 342public LocalState State; 343public LocalState StateWhenTrue; 344public LocalState StateWhenFalse; 347public PossiblyConditionalState(LocalState stateWhenTrue, LocalState stateWhenFalse) 355public PossiblyConditionalState(LocalState state) 377private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 421var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 842void learnFromNonNullTest(int inputSlot, ref LocalState state) 922void gotoNode(BoundDecisionDagNode node, LocalState state, bool believedReachable, BoundDecisionDagNode from, bool whenTrueBranch) 1083var endState = UnreachableState(); 1181PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1195var armState = getStateForArm(arm, labelStateMap); 1226PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1238LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap) 1255var trueState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenFalseLabel : node.WhenTrueLabel, out var s1) ? s1.state : UnreachableState(); 1256var falseState = labelStateMap.TryGetValue(node.IsNegated ? node.WhenTrueLabel : node.WhenFalseLabel, out var s2) ? s2.state : UnreachableState();