Table of Contents

Class IrBasicBlock

Namespace
MuLang.IR
Assembly
MuLang.IR.dll

Represents a basic block in a MuLang IR function.

public sealed record IrBasicBlock : IEquatable<IrBasicBlock>
Inheritance
IrBasicBlock
Implements
Inherited Members

Constructors

IrBasicBlock(int, IReadOnlyCollection<IrInstruction>, IrTerminator)

Initializes a new instance of the IrBasicBlock class using root lifetime ownership.

[Obsolete("Use the constructor that includes lifetime ownership.")]
public IrBasicBlock(int Id, IReadOnlyCollection<IrInstruction> Instructions, IrTerminator Terminator)

Parameters

Id int

The block identifier within the function.

Instructions IReadOnlyCollection<IrInstruction>

The instructions executed by the block.

Terminator IrTerminator

The control-flow terminator.

IrBasicBlock(int, IReadOnlyCollection<IrInstruction>, IrTerminator, int)

Represents a basic block in a MuLang IR function.

public IrBasicBlock(int Id, IReadOnlyCollection<IrInstruction> Instructions, IrTerminator Terminator, int LifetimeRegion)

Parameters

Id int

The block identifier within the function.

Instructions IReadOnlyCollection<IrInstruction>

The instructions executed by the block.

Terminator IrTerminator

The control-flow terminator.

LifetimeRegion int

The owning lifetime-region identifier.

Properties

Id

The block identifier within the function.

public int Id { get; init; }

Property Value

int

Instructions

The instructions executed by the block.

public IReadOnlyCollection<IrInstruction> Instructions { get; init; }

Property Value

IReadOnlyCollection<IrInstruction>

LifetimeRegion

The owning lifetime-region identifier.

public int LifetimeRegion { get; init; }

Property Value

int

Terminator

The control-flow terminator.

public IrTerminator Terminator { get; init; }

Property Value

IrTerminator

Methods

Deconstruct(out int, out IReadOnlyCollection<IrInstruction>, out IrTerminator)

Deconstructs the block using the legacy component shape.

[Obsolete("Use the deconstruction shape that includes lifetime ownership.")]
public void Deconstruct(out int Id, out IReadOnlyCollection<IrInstruction> Instructions, out IrTerminator Terminator)

Parameters

Id int

The block identifier within the function.

Instructions IReadOnlyCollection<IrInstruction>

The instructions executed by the block.

Terminator IrTerminator

The control-flow terminator.

Deconstruct(out int, out IReadOnlyCollection<IrInstruction>, out IrTerminator, out int)

public void Deconstruct(out int Id, out IReadOnlyCollection<IrInstruction> Instructions, out IrTerminator Terminator, out int LifetimeRegion)

Parameters

Id int
Instructions IReadOnlyCollection<IrInstruction>
Terminator IrTerminator
LifetimeRegion int

Equals(IrBasicBlock?)

public bool Equals(IrBasicBlock? other)

Parameters

other IrBasicBlock

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 ==(IrBasicBlock?, IrBasicBlock?)

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

Parameters

left IrBasicBlock
right IrBasicBlock

Returns

bool

operator !=(IrBasicBlock?, IrBasicBlock?)

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

Parameters

left IrBasicBlock
right IrBasicBlock

Returns

bool