Class IrSlot
Describes a value slot in a MuLang IR function.
public sealed record IrSlot : IEquatable<IrSlot>
- Inheritance
-
IrSlot
- Implements
- Inherited Members
Constructors
IrSlot(int, IrSlotKind, TypeSymbol, IrSlotMutability, int)
Initializes a new instance of the IrSlot class.
public IrSlot(int id, IrSlotKind kind, TypeSymbol type, IrSlotMutability mutability, int lifetimeRegion)
Parameters
idintThe slot identifier within the function.
kindIrSlotKindThe slot kind.
typeTypeSymbolThe static slot type.
mutabilityIrSlotMutabilityThe slot mutability.
lifetimeRegionintThe owning lifetime-region identifier.
Exceptions
- ArgumentNullException
Thrown when
typeisnull.- ArgumentOutOfRangeException
Thrown when
kindormutabilityis not defined, or when an identifier is negative.
IrSlot(int, IrSlotKind, TypeSymbol, string?)
Initializes a new instance of the IrSlot class using default mutability and lifetime ownership. The Name value is ignored.
[Obsolete("The Name value is ignored. Use the constructor without Name and IrProgram.Attributes slot attributes instead.")]
public IrSlot(int Id, IrSlotKind Kind, TypeSymbol Type, string? Name)
Parameters
IdintThe slot identifier within the function.
KindIrSlotKindThe slot kind.
TypeTypeSymbolThe static slot type.
NamestringAn ignored compatibility value. Use Attributes for source names.
IrSlot(int, IrSlotKind, TypeSymbol, string?, IrSlotMutability)
Initializes a new instance of the IrSlot class with explicit mutability. The name value is ignored.
[Obsolete("The name value is ignored. Use the constructor without name and IrProgram.Attributes slot attributes instead.")]
public IrSlot(int id, IrSlotKind kind, TypeSymbol type, string? name, IrSlotMutability mutability)
Parameters
idintThe slot identifier within the function.
kindIrSlotKindThe slot kind.
typeTypeSymbolThe static slot type.
namestringAn ignored compatibility value. Use Attributes for source names.
mutabilityIrSlotMutabilityThe slot mutability.
IrSlot(int, IrSlotKind, TypeSymbol, string?, IrSlotMutability, int)
Initializes a new instance of the IrSlot class. The Name value is ignored.
[Obsolete("The Name value is ignored. Use IrProgram.Attributes slot attributes instead.")]
public IrSlot(int Id, IrSlotKind Kind, TypeSymbol Type, string? Name, IrSlotMutability Mutability, int LifetimeRegion)
Parameters
IdintThe slot identifier within the function.
KindIrSlotKindThe slot kind.
TypeTypeSymbolThe static slot type.
NamestringAn ignored compatibility value. Use Attributes for source names.
MutabilityIrSlotMutabilityThe slot mutability.
LifetimeRegionintThe owning lifetime-region identifier.
Properties
Id
Gets the slot identifier within the function.
public int Id { get; init; }
Property Value
Kind
Gets the slot kind.
public IrSlotKind Kind { get; init; }
Property Value
LifetimeRegion
Gets the owning lifetime-region identifier.
public int LifetimeRegion { get; init; }
Property Value
Mutability
Gets the slot mutability.
public IrSlotMutability Mutability { get; init; }
Property Value
Name
Gets an unused compatibility value. Source names are stored in Attributes.
[Obsolete("This property is unused. Use IrProgram.Attributes slot attributes instead.")]
public string? Name { get; init; }
Property Value
Type
Gets the static slot type.
public TypeSymbol Type { get; init; }
Property Value
Methods
Deconstruct(out int, out IrSlotKind, out TypeSymbol, out IrSlotMutability, out int)
Deconstructs the slot without the unused compatibility name.
public void Deconstruct(out int Id, out IrSlotKind Kind, out TypeSymbol Type, out IrSlotMutability Mutability, out int LifetimeRegion)
Parameters
IdintThe slot identifier within the function.
KindIrSlotKindThe slot kind.
TypeTypeSymbolThe static slot type.
MutabilityIrSlotMutabilityThe slot mutability.
LifetimeRegionintThe owning lifetime-region identifier.
Deconstruct(out int, out IrSlotKind, out TypeSymbol, out string?)
Deconstructs the slot using the legacy component shape. The returned name is always null.
[Obsolete("The Name value is always null. Use the deconstruction shape without Name and IrProgram.Attributes slot attributes instead.")]
public void Deconstruct(out int Id, out IrSlotKind Kind, out TypeSymbol Type, out string? Name)
Parameters
IdintThe slot identifier within the function.
KindIrSlotKindThe slot kind.
TypeTypeSymbolThe static slot type.
NamestringAlways
null. Use Attributes for source names.
Deconstruct(out int, out IrSlotKind, out TypeSymbol, out string?, out IrSlotMutability, out int)
Deconstructs the slot using the legacy complete component shape. The returned name is always null.
[Obsolete("The Name value is always null. Use the deconstruction shape without Name and IrProgram.Attributes slot attributes instead.")]
public void Deconstruct(out int Id, out IrSlotKind Kind, out TypeSymbol Type, out string? Name, out IrSlotMutability Mutability, out int LifetimeRegion)
Parameters
IdintThe slot identifier within the function.
KindIrSlotKindThe slot kind.
TypeTypeSymbolThe static slot type.
NamestringAlways
null. Use Attributes for source names.MutabilityIrSlotMutabilityThe slot mutability.
LifetimeRegionintThe owning lifetime-region identifier.
Equals(IrSlot?)
public bool Equals(IrSlot? other)
Parameters
otherIrSlot
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(IrSlot?, IrSlot?)
public static bool operator ==(IrSlot? left, IrSlot? right)
Parameters
Returns
operator !=(IrSlot?, IrSlot?)
public static bool operator !=(IrSlot? left, IrSlot? right)