Table of Contents

Class IrSlot

Namespace
MuLang.IR
Assembly
MuLang.IR.dll

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

id int

The slot identifier within the function.

kind IrSlotKind

The slot kind.

type TypeSymbol

The static slot type.

mutability IrSlotMutability

The slot mutability.

lifetimeRegion int

The owning lifetime-region identifier.

Exceptions

ArgumentNullException

Thrown when type is null.

ArgumentOutOfRangeException

Thrown when kind or mutability is 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

Id int

The slot identifier within the function.

Kind IrSlotKind

The slot kind.

Type TypeSymbol

The static slot type.

Name string

An 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

id int

The slot identifier within the function.

kind IrSlotKind

The slot kind.

type TypeSymbol

The static slot type.

name string

An ignored compatibility value. Use Attributes for source names.

mutability IrSlotMutability

The 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

Id int

The slot identifier within the function.

Kind IrSlotKind

The slot kind.

Type TypeSymbol

The static slot type.

Name string

An ignored compatibility value. Use Attributes for source names.

Mutability IrSlotMutability

The slot mutability.

LifetimeRegion int

The owning lifetime-region identifier.

Properties

Id

Gets the slot identifier within the function.

public int Id { get; init; }

Property Value

int

Kind

Gets the slot kind.

public IrSlotKind Kind { get; init; }

Property Value

IrSlotKind

LifetimeRegion

Gets the owning lifetime-region identifier.

public int LifetimeRegion { get; init; }

Property Value

int

Mutability

Gets the slot mutability.

public IrSlotMutability Mutability { get; init; }

Property Value

IrSlotMutability

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

string

Type

Gets the static slot type.

public TypeSymbol Type { get; init; }

Property Value

TypeSymbol

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

Id int

The slot identifier within the function.

Kind IrSlotKind

The slot kind.

Type TypeSymbol

The static slot type.

Mutability IrSlotMutability

The slot mutability.

LifetimeRegion int

The 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

Id int

The slot identifier within the function.

Kind IrSlotKind

The slot kind.

Type TypeSymbol

The static slot type.

Name string

Always 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

Id int

The slot identifier within the function.

Kind IrSlotKind

The slot kind.

Type TypeSymbol

The static slot type.

Name string

Always null. Use Attributes for source names.

Mutability IrSlotMutability

The slot mutability.

LifetimeRegion int

The owning lifetime-region identifier.

Equals(IrSlot?)

public bool Equals(IrSlot? other)

Parameters

other IrSlot

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(IrSlot?, IrSlot?)

public static bool operator ==(IrSlot? left, IrSlot? right)

Parameters

left IrSlot
right IrSlot

Returns

bool

operator !=(IrSlot?, IrSlot?)

public static bool operator !=(IrSlot? left, IrSlot? right)

Parameters

left IrSlot
right IrSlot

Returns

bool