6 overrides of RefKind
Microsoft.CodeAnalysis.CSharp (6)
CodeGen\Optimizer.cs (1)
2428
public override RefKind
RefKind
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (1)
59
public override RefKind
RefKind
=> RefKind.None;
Symbols\Source\SourceLocalSymbol.cs (1)
480
public override RefKind
RefKind
Symbols\Synthesized\SynthesizedLocal.cs (1)
98
public sealed override RefKind
RefKind
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
105
public override RefKind
RefKind
Symbols\UpdatedContainingSymbolLocal.cs (1)
79
public override RefKind
RefKind
=> _underlyingLocal.RefKind;
61 references to RefKind
Microsoft.CodeAnalysis.CSharp (61)
Binder\Binder.ValueChecks.cs (4)
1037
if (localSymbol.
RefKind
== RefKind.RefReadOnly ||
1038
(localSymbol.
RefKind
== RefKind.None && !localSymbol.IsWritableVariable))
1046
if (localSymbol.
RefKind
== RefKind.None)
1078
if (localSymbol.
RefKind
== RefKind.None)
Binder\Binder_Expressions.cs (2)
2055
if (IsBadLocalOrParameterCapture(localSymbol, type, localSymbol.
RefKind
))
2059
if (localSymbol.
RefKind
== RefKind.None && type.IsRestrictedType(ignoreSpanLikeTypes: true))
Binder\Binder_Operators.cs (1)
2680
return localSymbol.
RefKind
!= RefKind.None;
Binder\RefSafetyAnalysis.cs (1)
1103
AddLocalScopes(local, refEscapeScope: local.
RefKind
== RefKind.None ? _localScopeDepth : collectionEscape, valEscapeScope: collectionEscape);
BoundTree\BoundExpressionExtensions.cs (1)
25
return ((BoundLocal)node).LocalSymbol.
RefKind
;
CodeGen\CodeGenerator_HasHome.cs (2)
94
return !((CodeGenerator.IsStackLocal(local, stackLocalsOpt) && local.
RefKind
== RefKind.None) ||
95
(!IsAnyReadOnly(addressKind) && local.
RefKind
== RefKind.RefReadOnly));
CodeGen\EmitAddress.cs (2)
274
if (local.
RefKind
!= RefKind.None)
282
throw ExceptionUtilities.UnexpectedValue(local.
RefKind
);
CodeGen\EmitExpression.cs (6)
1292
return ((BoundLocal)receiver).LocalSymbol.
RefKind
!= RefKind.None;
1392
bool isRefLocal = local.LocalSymbol.
RefKind
!= RefKind.None;
2214
return ((BoundLocal)receiver).LocalSymbol.
RefKind
!= RefKind.None;
2762
return ((BoundLocal)left).LocalSymbol.
RefKind
== RefKind.None;
2832
if (left.LocalSymbol.
RefKind
!= RefKind.None && !assignmentOperator.IsRef)
3077
if (local.LocalSymbol.
RefKind
!= RefKind.None && !assignment.IsRef)
CodeGen\EmitStatement.cs (5)
749
Debug.Assert(local.
RefKind
== RefKind.None || local.SynthesizedKind.IsLongLived(),
1147
Debug.Assert(exceptionSourceLocal.LocalSymbol.
RefKind
== RefKind.None);
1283
if (local.
RefKind
== RefKind.None && !IsStackLocal(local))
1789
Debug.Assert(local.
RefKind
== RefKind.None);
1805
(local.
RefKind
!= RefKind.None ? LocalSlotConstraints.ByRef : LocalSlotConstraints.None);
CodeGen\Optimizer.cs (11)
858
if (node.LocalSymbol.
RefKind
!= RefKind.None)
878
if (node.LocalSymbol.
RefKind
!= RefKind.None)
986
if (localSymbol.
RefKind
is RefKind.RefReadOnly or RefKindExtensions.StrictIn &&
1049
if (((BoundLocal)lhs).LocalSymbol.
RefKind
!= RefKind.None)
1221
if (unwrappedSequence is BoundLocal { LocalSymbol: {
RefKind
: not RefKind.None } localSymbol })
1428
if (localSym.
RefKind
== RefKind.None)
1874
Debug.Assert(local.
RefKind
== RefKind.None, "cannot take a ref of a ref");
1935
return top.Item2 == (local.
RefKind
== RefKind.None ? ExprContext.Value : ExprContext.Address) &&
2134
return new BoundDup(node.Syntax, node.LocalSymbol.
RefKind
, node.Type);
2162
var isIndirectLocalStore = left.LocalSymbol.
RefKind
!= RefKind.None && !node.IsRef;
2191
left.LocalSymbol.
RefKind
== RefKind.Ref &&
FlowAnalysis\AbstractFlowPass.cs (3)
1293
VisitRvalue(node.InitializerOpt, isKnownToBeAnLvalue: node.LocalSymbol.
RefKind
!= RefKind.None);
1296
if (node.LocalSymbol.
RefKind
!= RefKind.None)
1298
WriteArgument(node.InitializerOpt, node.LocalSymbol.
RefKind
, method: null);
FlowAnalysis\DefiniteAssignment.cs (2)
1571
if (local.LocalSymbol.
RefKind
!= RefKind.None && !isRef)
2771
NoteWrite(iterationVariable, null, read: true, isRef: iterationVariable.
RefKind
!= RefKind.None);
FlowAnalysis\NullableWalker.cs (1)
10148
case BoundLocal { LocalSymbol.
RefKind
: RefKind.None }:
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
1628
var localRefKind = ((BoundLocal)argument).LocalSymbol.
RefKind
;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
858
return localsMayBeAssignedOrCaptured || ((BoundLocal)expression).LocalSymbol.
RefKind
!= RefKind.None;
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
168
case BoundLocal { LocalSymbol: {
RefKind
: RefKind.None } localSymbol }:
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
36
if (pinnedTemp.
RefKind
== RefKind.None)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
489
return ((BoundLocal)expression).LocalSymbol.
RefKind
!= RefKind.None;
Lowering\MethodToClassRewriter.cs (1)
493
if (leftLocal.LocalSymbol.
RefKind
!= RefKind.None &&
Lowering\SpillSequenceSpiller.cs (5)
538
Left: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp,
RefKind
: RefKind.Ref } receiverRefLocal },
541
ValueTypeReceiver: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp,
RefKind
: RefKind.Ref } } valueTypeReceiver,
550
Left: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp,
RefKind
: RefKind.None } referenceTypeClone },
551
Right: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp,
RefKind
: RefKind.Ref } originalReceiverReference }
554
Value: BoundLocal { LocalSymbol: { SynthesizedKind: SynthesizedLocalKind.LoweringTemp,
RefKind
: RefKind.None } } referenceTypeReceiver
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
91
Debug.Assert(local.
RefKind
!= RefKind.None);
213
(variable is LocalSymbol {
RefKind
: not RefKind.None } refLocal && !canRefLocalBeHoisted(refLocal)))
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
313
if (local.
RefKind
!= RefKind.None)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
171
if (local.
RefKind
!= RefKind.None)
179
Debug.Assert(local.
RefKind
== RefKind.None);
Symbols\LocalSymbol.cs (1)
365
public bool IsRef =>
RefKind
!= RefKind.None;
Symbols\PublicModel\LocalSymbol.cs (1)
52
RefKind ILocalSymbol.RefKind => _underlying.
RefKind
;
Symbols\SymbolExtensions.cs (1)
518
refKind = local.
RefKind
;
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
107
get { return _originalVariable.
RefKind
; }