68 lines
2.9 KiB
C#
68 lines
2.9 KiB
C#
using System.Collections.Immutable;
|
|||
|
|
using Microsoft.CodeAnalysis.CSharp.Symbols;
|
||
|
|
using Microsoft.CodeAnalysis.CodeGen;
|
||
|
|
using Microsoft.CodeAnalysis.Symbols;
|
||
|
|
using Roslyn.Utilities;
|
||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp;
|
||
|
|
|
||
|
|
internal sealed class StateMachineFieldSymbol : SynthesizedFieldSymbolBase, ISynthesizedMethodBodyImplementationSymbol, ISymbolInternal
|
||
|
|
{
|
||
|
|
private readonly TypeWithAnnotations _type;
|
||
|
|
|
||
|
|
private readonly bool _isThis;
|
||
|
|
|
||
|
|
internal readonly int SlotIndex;
|
||
|
|
|
||
|
|
internal readonly LocalSlotDebugInfo SlotDebugInfo;
|
||
|
|
|
||
|
|
internal override bool SuppressDynamicAttribute => true;
|
||
|
|
|
||
|
|
public override RefKind RefKind => (RefKind)0;
|
||
|
|
|
||
|
|
public override ImmutableArray<CustomModifier> RefCustomModifiers => ImmutableArray<CustomModifier>.Empty;
|
||
|
|
|
||
|
|
bool ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency => true;
|
||
|
|
|
||
|
|
IMethodSymbolInternal ISynthesizedMethodBodyImplementationSymbol.Method => ((ISynthesizedMethodBodyImplementationSymbol)ContainingSymbol).Method;
|
||
|
|
|
||
|
|
internal override bool IsCapturedFrame => _isThis;
|
||
|
|
|
||
|
|
public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, bool isPublic, bool isThis)
|
||
|
|
: this(stateMachineType, type, name, new LocalSlotDebugInfo((SynthesizedLocalKind)(-2), LocalDebugId.None), -1, isPublic)
|
||
|
|
{
|
||
|
|
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
_isThis = isThis;
|
||
|
|
}
|
||
|
|
|
||
|
|
public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, SynthesizedLocalKind synthesizedKind, int slotIndex, bool isPublic)
|
||
|
|
: this(stateMachineType, type, name, new LocalSlotDebugInfo(synthesizedKind, LocalDebugId.None), slotIndex, isPublic)
|
||
|
|
{
|
||
|
|
}//IL_0004: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
|
||
|
|
|
||
|
|
public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic)
|
||
|
|
: this(stateMachineType, TypeWithAnnotations.Create(type), name, slotDebugInfo, slotIndex, isPublic)
|
||
|
|
{
|
||
|
|
}//IL_0013: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
|
||
|
|
|
||
|
|
public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic)
|
||
|
|
: base(stateMachineType, name, isPublic, isReadOnly: false, isStatic: false)
|
||
|
|
{
|
||
|
|
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
_type = type;
|
||
|
|
SlotIndex = slotIndex;
|
||
|
|
SlotDebugInfo = slotDebugInfo;
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
|
||
|
|
{
|
||
|
|
return _type;
|
||
|
|
}
|
||
|
|
}
|