5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
14072return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 14101return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 14124return new LocalState(variables.Id, container, CreateBitVector(reachable)); 14130return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 14330return new LocalState(Id, container, _state.Clone());
142 references to LocalState
Microsoft.CodeAnalysis.CSharp (142)
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();
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;)"/>. 681void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 760void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1133private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1183void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1195void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1211private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1220private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1351private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1397private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1410private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1419bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense, LocalState stateWhen) 1457private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1760Analyze(walker, symbol, diagnostics: null, LocalState.Create(localState), snapshotBuilderOpt: newSnapshotBuilder); 1881var localState = LocalState.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables); 1934Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<LocalState>)default : LocalState.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis); 1951Optional<LocalState> initialState, 2045private NullableFlowState GetState(ref LocalState state, int slot) 2054private void SetState(ref LocalState state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false) 2063private void NormalizeIfNeeded(ref LocalState state, int slot, bool useNotNullsAsDefault) 2068protected override void Normalize(ref LocalState state) 2076private NullableFlowState GetDefaultState(ref LocalState state, int slot) 2917private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2923var tryState = NonMonotonicState.Value; 2932protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2934var tryState = other.GetStateForVariables(self.Id); 3028protected override LocalState TopState() 3030var state = LocalState.ReachableState(_variables); 3035protected override LocalState UnreachableState() 3037return LocalState.UnreachableState(_variables); 3040protected override LocalState ReachableBottomState() 3043return LocalState.ReachableStateWithNotNulls(_variables); 3076var parameterDefaultsNotAssignedState = State.Clone(); 3201var joinedState = this.StateWhenTrue.Clone(); 3432var state = TopState(); 3458var startingState = localFunctionState.StartingState; 3501LocalState state, 3527var oldState = this.State; 3604void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3631var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3772var currentState = State; 4997private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5497var stateAfterLeft = this.State; 5500var stateWhenNotNull = this.State; 5556LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5558LocalState stateWhenNotNull; 5594var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5943ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5949protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 6054private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 6062private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 6085private void LearnFromNonNullTest(int slot, ref LocalState state) 6090private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 6108private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 6128private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 6209var leftState = this.State.Clone(); 6430var savedState = this.State.Clone(); 6539var consequenceState = this.StateWhenTrue; 6540var alternativeState = this.StateWhenFalse; 6665BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6712LocalState consequenceState, 6713LocalState alternativeState, 6733(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6746(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6769LocalState state, 8097void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 8110void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8138LocalState markMemberAsNotNull(int receiverSlot, ref LocalState state, Symbol member) 8542var originalWhenFalse = StateWhenFalse.Clone(); 8548var newWhenTrue = State.Clone(); 8729private static VariableState GetVariableState(Variables variables, LocalState localState) 9457var savedState = this.State.Clone(); 9898Optional<LocalState> stateForLambda = default, 11215var stateForLambda = this.State.Clone(); 11227private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 13091var leftTrue = this.StateWhenTrue; 13092var leftFalse = this.StateWhenFalse; 13108var leftTrue = this.StateWhenTrue; 13109var leftFalse = this.StateWhenFalse; 13121var rightState = State.Clone(); 13138var leftState = isAnd ? leftFalse : leftTrue; 13175protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 13268LocalState stateWhenNotNull; 13938protected override string Dump(LocalState state) 13943protected override bool Meet(ref LocalState self, ref LocalState other) 13960protected override bool Join(ref LocalState self, ref LocalState other) 13997private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 14004var state = conditionalState.StateWhenTrue.Clone(); 14046internal LocalState Value; 14048internal Boxed(LocalState value) 14069internal static LocalState Create(LocalStateSnapshot snapshot) 14084public static LocalState ReachableState(Variables variables) 14089public static LocalState UnreachableState(Variables variables) 14094public static LocalState ReachableStateWithNotNulls(Variables variables) 14118private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 14127public LocalState CreateNestedMethodState(Variables variables) 14156bool hasVariableCore(ref LocalState state, int id, int index) 14174static bool hasValue(ref LocalState state, int slot) 14184static bool hasValueCore(ref LocalState state, int id, int index) 14313internal LocalState GetStateForVariables(int id) 14315var state = this; 14327public LocalState Clone() 14333public bool Join(in LocalState other) 14362public bool Meet(in LocalState other) 14453public LocalState StartingState; 14455public LocalFunctionState(LocalState unreachableState) 14467return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)