3 instantiations of LocalState
Microsoft.CodeAnalysis.CSharp (3)
FlowAnalysis\NullableWalker.cs (3)
12343
return new
LocalState
(variables.Id, container, createBitVectorWithNotNulls(capacity, reachable: true));
12366
return new
LocalState
(variables.Id, container, CreateBitVector(reachable));
12372
return new
LocalState
(variables.Id, container: new Boxed(this), CreateBitVector(reachable: true));
132 references to LocalState
Microsoft.CodeAnalysis.CSharp (132)
FlowAnalysis\NullableWalker.cs (113)
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, bool, Optional<
LocalState
>,bool, Location, ArrayBuilder<VisitResult>)"/>.
623
void enforceMemberNotNull(SyntaxNode? syntaxOpt,
LocalState
state)
704
void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member,
LocalState
state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis)
1041
private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt,
LocalState
state, MethodSymbol method, string memberName)
1091
void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members,
LocalState
state,
LocalState
otherState)
1103
void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense,
LocalState
state)
1119
private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member,
LocalState
state)
1128
private bool FailsMemberNotNullExpectation(Symbol member,
LocalState
state)
1252
private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt,
LocalState
state)
1292
private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense,
LocalState
stateWhen)
1305
private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense,
LocalState
stateWhen)
1314
bool parameterHasBadConditionalState(ParameterSymbol parameter, bool sense,
LocalState
stateWhen)
1352
private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt,
LocalState
state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam)
1652
Analyze(walker, symbol, diagnostics: null,
LocalState
.Create(localState), snapshotBuilderOpt: newSnapshotBuilder);
1769
var
localState =
LocalState
.Create(initialState.VariableNullableStates).CreateNestedMethodState(variables);
1817
Analyze(walker, symbol, diagnostics, initialState is null ? (Optional<
LocalState
>)default :
LocalState
.Create(initialState.VariableNullableStates), snapshotBuilderOpt, requiresAnalysis);
1834
Optional<
LocalState
> initialState,
1928
private NullableFlowState GetState(ref
LocalState
state, int slot)
1937
private void SetState(ref
LocalState
state, int slot, NullableFlowState value, bool useNotNullsAsDefault = false)
1946
private void NormalizeIfNeeded(ref
LocalState
state, int slot, bool useNotNullsAsDefault)
1951
protected override void Normalize(ref
LocalState
state)
1959
private NullableFlowState GetDefaultState(ref
LocalState
state, int slot)
2748
private void SetStateAndTrackForFinally(ref
LocalState
state, int slot, NullableFlowState newState)
2754
var
tryState = NonMonotonicState.Value;
2763
protected override void JoinTryBlockState(ref
LocalState
self, ref
LocalState
other)
2765
var
tryState = other.GetStateForVariables(self.Id);
2819
protected override
LocalState
TopState()
2821
var
state =
LocalState
.ReachableState(_variables);
2826
protected override
LocalState
UnreachableState()
2828
return
LocalState
.UnreachableState(_variables);
2831
protected override
LocalState
ReachableBottomState()
2834
return
LocalState
.ReachableStateWithNotNulls(_variables);
2867
var
parameterDefaultsNotAssignedState = State.Clone();
2992
var
joinedState = this.StateWhenTrue.Clone();
3223
var
state = TopState();
3249
var
startingState = localFunctionState.StartingState;
3292
LocalState
state,
3318
var
oldState = this.State;
3395
void enforceMemberNotNull(SyntaxNode? syntax,
LocalState
state)
3422
var
state = State.GetStateForVariables(localFunctionState.StartingState.Id);
3538
var
currentState = State;
4474
private void SetNotNullResultForLambda(BoundExpression node,
LocalState
stateForLambda)
4973
var
stateAfterLeft = this.State;
4976
var
stateWhenNotNull = this.State;
5032
LocalState
getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull)
5034
LocalState
stateWhenNotNull;
5070
var
stateWhenNotNull = getUnconditionalStateWhenNotNull(leftOperand, conditionalStateWhenNotNull);
5346
ref
LocalState
stateToUpdate = ref whenTrue ? ref this.StateWhenTrue : ref this.StateWhenFalse;
5352
protected override bool VisitInterpolatedStringHandlerParts(BoundInterpolatedStringBase node, bool usesBoolReturns, bool firstPartIsConditional, ref
LocalState
shortCircuitState)
5457
private void MarkSlotsAsNotNull(ArrayBuilder<int> slots, ref
LocalState
stateToUpdate)
5465
private void LearnFromNonNullTest(BoundExpression expression, ref
LocalState
state)
5488
private void LearnFromNonNullTest(int slot, ref
LocalState
state)
5493
private void LearnFromNullTest(BoundExpression expression, ref
LocalState
state)
5511
private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref
LocalState
state, bool markDependentSlotsNotNull)
5531
private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref
LocalState
state, int depth = 2)
5612
var
leftState = this.State.Clone();
5830
var
savedState = this.State.Clone();
5939
var
consequenceState = this.StateWhenTrue;
5940
var
alternativeState = this.StateWhenFalse;
6065
BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative,
LocalState
consequenceState,
LocalState
alternativeState,
6112
LocalState
consequenceState,
6113
LocalState
alternativeState,
6133
(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(
LocalState
state, BoundExpression operand)
6146
(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(
LocalState
state, BoundExpression operand)
6169
LocalState
state,
7231
void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref
LocalState
state)
7244
void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref
LocalState
state)
7668
var
originalWhenFalse = StateWhenFalse.Clone();
7674
var
newWhenTrue = State.Clone();
7836
private static VariableState GetVariableState(Variables variables,
LocalState
localState)
8467
var
savedState = this.State.Clone();
8850
Optional<
LocalState
> stateForLambda = default,
9912
var
stateForLambda = this.State.Clone();
9924
private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<
LocalState
> initialState = default)
11413
protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref
LocalState
leftTrue, ref
LocalState
leftFalse)
11572
LocalState
stateWhenNotNull;
12064
protected override void VisitCatchBlock(BoundCatchBlock node, ref
LocalState
finallyState)
12180
protected override string Dump(
LocalState
state)
12185
protected override bool Meet(ref
LocalState
self, ref
LocalState
other)
12202
protected override bool Join(ref
LocalState
self, ref
LocalState
other)
12239
private
LocalState
CloneAndUnsplit(ref PossiblyConditionalState conditionalState)
12246
var
state = conditionalState.StateWhenTrue.Clone();
12288
internal
LocalState
Value;
12290
internal Boxed(
LocalState
value)
12311
internal static
LocalState
Create(LocalStateSnapshot snapshot)
12326
public static
LocalState
ReachableState(Variables variables)
12331
public static
LocalState
UnreachableState(Variables variables)
12336
public static
LocalState
ReachableStateWithNotNulls(Variables variables)
12360
private static
LocalState
CreateReachableOrUnreachableState(Variables variables, bool reachable)
12369
public
LocalState
CreateNestedMethodState(Variables variables)
12398
bool hasVariableCore(ref
LocalState
state, int id, int index)
12416
static bool hasValue(ref
LocalState
state, int slot)
12426
static bool hasValueCore(ref
LocalState
state, int id, int index)
12555
internal
LocalState
GetStateForVariables(int id)
12557
var
state = this;
12569
public
LocalState
Clone()
12575
public bool Join(in
LocalState
other)
12604
public bool Meet(in
LocalState
other)
12695
public
LocalState
StartingState;
12697
public LocalFunctionState(
LocalState
unreachableState)
12709
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;
273
protected override
LocalState
VisitSwitchStatementDispatch(BoundSwitchStatement node)
339
public
LocalState
State;
340
public
LocalState
StateWhenTrue;
341
public
LocalState
StateWhenFalse;
344
public PossiblyConditionalState(
LocalState
stateWhenTrue,
LocalState
stateWhenFalse)
352
public PossiblyConditionalState(
LocalState
state)
374
private PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> LearnFromDecisionDag(
416
var labelStateMap = PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)>.GetInstance();
729
void learnFromNonNullTest(int inputSlot, ref
LocalState
state)
804
void gotoNode(BoundDecisionDagNode node,
LocalState
state, bool believedReachable)
893
var
endState = UnreachableState();
987
PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap,
1001
var
armState = getStateForArm(arm, labelStateMap);
1032
PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap,
1044
LocalState
getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (
LocalState
state, bool believedReachable)> labelStateMap)