3 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (3)
FlowAnalysis\NullableWalker.cs (3)
12098
return new
LocalState
(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true));
12121
return new
LocalState
(variables.Id, container, CreateBitVector(reachable));
12127
return new
LocalState
(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true));
131 references to LocalState
Microsoft.CodeAnalysis.CSharp (131)
FlowAnalysis\NullableWalker.cs (112)
27
: LocalDataFlowPass<NullableWalker.
LocalState
, NullableWalker.LocalFunctionState>
104
public readonly Optional<
LocalState
> StateForLambda;
120
public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<
LocalState
> stateForLambda)
247
/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, Optional<
LocalState
>,bool, Location, ArrayBuilder<VisitResult>)"/>.
622
void enforceMemberNotNull(SyntaxNode? syntaxOpt,
LocalState
state)
703
void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member,
LocalState
state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis)
790
void enforceMemberNotNullOnMember(SyntaxNode? syntaxOpt,
LocalState
state, MethodSymbol method, string memberName)
836
void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members,
LocalState
state,
LocalState
otherState)
848
void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense,
LocalState
state)
863
void reportMemberIfBadConditionalState(SyntaxNode? syntaxOpt, bool sense, Symbol member,
LocalState
state)
872
bool memberHasBadState(Symbol member,
LocalState
state)
1178
private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt,
LocalState
state)
1218
private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense,
LocalState
stateWhen)
1231
private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense,
LocalState
stateWhen)
1240
bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense,
LocalState
stateWhen)
1278
private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt,
LocalState
state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam)
1578
Analyze(walker, symbol, diagnostics: null,
LocalState
.Create(localState), snapshotBuilderOpt: newSnapshotBuilder);
1695
var
localState =
LocalState
.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables);
1743
Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<
LocalState
>)default :
LocalState
.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis);
1760
Optional<
LocalState
> initialState,
1854
private NullableFlowState GetState(ref
LocalState
state, int slot)
1863
private void SetState(ref
LocalState
state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false)
1872
private void NormalizeIfNeeded(ref
LocalState
state, int slot, bool useNotNullsAsDefault)
1877
protected override void Normalize(ref
LocalState
state)
1885
private NullableFlowState GetDefaultState(ref
LocalState
state, int slot)
2650
private void SetStateAndTrackForFinally(ref
LocalState
state, int slot, NullableFlowState newState)
2656
var
tryState = NonMonotonicState.Value;
2665
protected override void JoinTryBlockState(ref
LocalState
self, ref
LocalState
other)
2667
var
tryState = other.GetStateForVariables(self.Id);
2721
protected override
LocalState
TopState()
2723
var
state =
LocalState
.ReachableState(_variables);
2728
protected override
LocalState
UnreachableState()
2730
return
LocalState
.UnreachableState(_variables);
2733
protected override
LocalState
ReachableBottomState()
2736
return
LocalState
.ReachableStateWithNotNulls(_variables);
2769
var
parameterDefaultsNotAssignedState = State.Clone();
2894
var
joinedState = this.StateWhenTrue.Clone();
3125
var
state = TopState();
3151
var
startingState = localFunctionState.StartingState;
3194
LocalState
state,
3220
var
oldState = this.State;
3290
var
state = State.GetStateForVariables(localFunctionState.StartingState.Id);
3406
var
currentState = State;
4297
private void SetNotNullResultForLambda(BoundExpression node,
LocalState
stateForLambda)
4796
var
stateAfterLeft = this.State;
4799
var
stateWhenNotNull = this.State;
4855
LocalState
getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull)
4857
LocalState
stateWhenNotNull;
4893
var
stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull);
5169
ref
LocalState
stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse;
5175
protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref
LocalState
shortCircuitState)
5280
private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref
LocalState
stateToUpdate)
5288
private void LearnFromNonNullTest(BoundExpression expression, ref
LocalState
state)
5311
private void LearnFromNonNullTest(int slot, ref
LocalState
state)
5316
private void LearnFromNullTest(BoundExpression expression, ref
LocalState
state)
5334
private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref
LocalState
state, bool markDependentSlotsNotNull)
5354
private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref
LocalState
state, int depth = 2)
5435
var
leftState = this.State.Clone();
5653
var
savedState = this.State.Clone();
5762
var
consequenceState = this.StateWhenTrue;
5763
var
alternativeState = this.StateWhenFalse;
5888
BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative,
LocalState
consequenceState,
LocalState
alternativeState,
5935
LocalState
consequenceState,
5936
LocalState
alternativeState,
5956
(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(
LocalState
state, BoundExpression operand)
5969
(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(
LocalState
state, BoundExpression operand)
5992
LocalState
state,
7022
void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref
LocalState
state)
7035
void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref
LocalState
state)
7453
var
originalWhenFalse = StateWhenFalse.Clone();
7459
var
newWhenTrue = State.Clone();
7621
private static VariableState GetVariableState(Variables variables,
LocalState
localState)
8251
var
savedState = this.State.Clone();
8633
Optional<
LocalState
> stateForLambda = default,
9685
var
stateForLambda = this.State.Clone();
9697
private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<
LocalState
> initialState = default)
11168
protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref
LocalState
leftTrue, ref
LocalState
leftFalse)
11327
LocalState
stateWhenNotNull;
11819
protected override void VisitCatchBlock(BoundCatchBlock node, ref
LocalState
finallyState)
11935
protected override string Dump(
LocalState
state)
11940
protected override bool Meet(ref
LocalState
self, ref
LocalState
other)
11957
protected override bool Join(ref
LocalState
self, ref
LocalState
other)
11994
private
LocalState
CloneAndUnsplit(ref PossiblyConditionalState conditionalState)
12001
var
state = conditionalState.StateWhenTrue.Clone();
12043
internal
LocalState
Value;
12045
internal Boxed(
LocalState
value)
12066
internal static
LocalState
Create(LocalStateSnapshot snapshot)
12081
public static
LocalState
ReachableState(Variables variables)
12086
public static
LocalState
UnreachableState(Variables variables)
12091
public static
LocalState
ReachableStateWithNotNulls(Variables variables)
12115
private static
LocalState
CreateReachableOrUnreachableState(Variables variables, bool reachable)
12124
public
LocalState
CreateNestedMethodState(Variables variables)
12153
bool hasVariableCore(ref
LocalState
state, int id, int index)
12171
static bool hasValue(ref
LocalState
state, int slot)
12181
static bool hasValueCore(ref
LocalState
state, int id, int index)
12310
internal
LocalState
GetStateForVariables(int id)
12312
var
state = this;
12324
public
LocalState
Clone()
12330
public bool Join(in
LocalState
other)
12359
public bool Meet(in
LocalState
other)
12450
public
LocalState
StartingState;
12452
public LocalFunctionState(
LocalState
unreachableState)
12464
return new LocalFunctionState(
LocalState
.UnreachableState(variables));
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
208
internal void TakeIncrementalSnapshot(BoundNode? node,
LocalState
currentState)
FlowAnalysis\NullableWalker_Patterns.cs (18)
37
var
currentState = State;
235
protected override
LocalState
VisitSwitchStatementDispatch(BoundSwitchStatement node)
301
public
LocalState
State;
302
public
LocalState
StateWhenTrue;
303
public
LocalState
StateWhenFalse;
306
public PossiblyConditionalState(
LocalState
stateWhenTrue,
LocalState
stateWhenFalse)
314
public PossiblyConditionalState(
LocalState
state)
336
private PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> LearnFromDecisionDag(
378
var labelStateMap = PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)>.GetInstance();
691
void learnFromNonNullTest(int inputSlot, ref
LocalState
state)
766
void gotoNode(BoundDecisionDagNode node,
LocalState
state, bool believedReachable)
855
var
endState = UnreachableState();
949
PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap,
963
var
armState = getStateForArm(arm, labelStateMap);
994
PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap,
1006
LocalState
getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap)