5 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (5)
FlowAnalysis\NullableWalker.cs (5)
14089return new LocalState(snapshot.Id, container, snapshot.State.Clone()); 14118return new LocalState(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true)); 14141return new LocalState(variables.Id, container, CreateBitVector(reachable)); 14147return new LocalState(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true)); 14347return 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) 2910private void SetStateAndTrackForFinally(ref LocalState state, int slot, NullableFlowState newState) 2916var tryState = NonMonotonicState.Value; 2925protected override void JoinTryBlockState(ref LocalState self, ref LocalState other) 2927var tryState = other.GetStateForVariables(self.Id); 3021protected override LocalState TopState() 3023var state = LocalState.ReachableState(_variables); 3028protected override LocalState UnreachableState() 3030return LocalState.UnreachableState(_variables); 3033protected override LocalState ReachableBottomState() 3036return LocalState.ReachableStateWithNotNulls(_variables); 3069var parameterDefaultsNotAssignedState = State.Clone(); 3194var joinedState = this.StateWhenTrue.Clone(); 3425var state = TopState(); 3451var startingState = localFunctionState.StartingState; 3494LocalState state, 3520var oldState = this.State; 3597void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3624var state = State.GetStateForVariables(localFunctionState.StartingState.Id); 3765var currentState = State; 5007private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda) 5507var stateAfterLeft = this.State; 5510var stateWhenNotNull = this.State; 5566LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull) 5568LocalState stateWhenNotNull; 5604var stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull); 5953ref LocalState stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse; 5959protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref LocalState shortCircuitState) 6064private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref LocalState stateToUpdate) 6072private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state) 6095private void LearnFromNonNullTest(int slot, ref LocalState state) 6100private void LearnFromNullTest(BoundExpression expression, ref LocalState state) 6118private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull) 6138private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2) 6219var leftState = this.State.Clone(); 6440var savedState = this.State.Clone(); 6549var consequenceState = this.StateWhenTrue; 6550var alternativeState = this.StateWhenFalse; 6675BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState, 6722LocalState consequenceState, 6723LocalState alternativeState, 6743(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6756(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6779LocalState state, 8114void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state) 8127void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state) 8155LocalState markMemberAsNotNull(int receiverSlot, ref LocalState state, Symbol member) 8559var originalWhenFalse = StateWhenFalse.Clone(); 8565var newWhenTrue = State.Clone(); 8746private static VariableState GetVariableState(Variables variables, LocalState localState) 9474var savedState = this.State.Clone(); 9915Optional<LocalState> stateForLambda = default, 11232var stateForLambda = this.State.Clone(); 11244private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 13108var leftTrue = this.StateWhenTrue; 13109var leftFalse = this.StateWhenFalse; 13125var leftTrue = this.StateWhenTrue; 13126var leftFalse = this.StateWhenFalse; 13138var rightState = State.Clone(); 13155var leftState = isAnd ? leftFalse : leftTrue; 13192protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 13285LocalState stateWhenNotNull; 13955protected override string Dump(LocalState state) 13960protected override bool Meet(ref LocalState self, ref LocalState other) 13977protected override bool Join(ref LocalState self, ref LocalState other) 14014private LocalState CloneAndUnsplit(ref PossiblyConditionalState conditionalState) 14021var state = conditionalState.StateWhenTrue.Clone(); 14063internal LocalState Value; 14065internal Boxed(LocalState value) 14086internal static LocalState Create(LocalStateSnapshot snapshot) 14101public static LocalState ReachableState(Variables variables) 14106public static LocalState UnreachableState(Variables variables) 14111public static LocalState ReachableStateWithNotNulls(Variables variables) 14135private static LocalState CreateReachableOrUnreachableState(Variables variables, bool reachable) 14144public LocalState CreateNestedMethodState(Variables variables) 14173bool hasVariableCore(ref LocalState state, int id, int index) 14191static bool hasValue(ref LocalState state, int slot) 14201static bool hasValueCore(ref LocalState state, int id, int index) 14330internal LocalState GetStateForVariables(int id) 14332var state = this; 14344public LocalState Clone() 14350public bool Join(in LocalState other) 14379public bool Meet(in LocalState other) 14470public LocalState StartingState; 14472public LocalFunctionState(LocalState unreachableState) 14484return new LocalFunctionState(LocalState.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208internal void TakeIncrementalSnapshot(BoundNode? node, LocalState currentState)