Table of Contents

Class IrFunction

Namespace
MuLang.IR
Assembly
MuLang.IR.dll

Represents an entry or user-defined function in portable MuLang IR.

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

Constructors

IrFunction(string, TypeSymbol, int, IReadOnlyList<IrSlot>, IReadOnlyList<IrBasicBlock>)

Initializes a new instance of the IrFunction class using a root lifetime region.

[Obsolete("Use the constructor that includes lifetime and exception regions.")]
public IrFunction(string Id, TypeSymbol ReturnType, int EntryBlock, IReadOnlyList<IrSlot> Slots, IReadOnlyList<IrBasicBlock> Blocks)

Parameters

Id string

The function identifier.

ReturnType TypeSymbol

The declared return type.

EntryBlock int

The identifier of the entry block.

Slots IReadOnlyList<IrSlot>

The slots available to the function.

Blocks IReadOnlyList<IrBasicBlock>

The function basic blocks.

IrFunction(string, TypeSymbol, int, IReadOnlyList<IrSlot>, IReadOnlyList<IrBasicBlock>, IReadOnlyList<IrLifetimeRegion>)

Initializes a new instance of the IrFunction class without exception regions.

[Obsolete("Use the constructor that includes exception regions.")]
public IrFunction(string id, TypeSymbol returnType, int entryBlock, IReadOnlyList<IrSlot> slots, IReadOnlyList<IrBasicBlock> blocks, IReadOnlyList<IrLifetimeRegion> lifetimeRegions)

Parameters

id string

The function identifier.

returnType TypeSymbol

The declared return type.

entryBlock int

The identifier of the entry block.

slots IReadOnlyList<IrSlot>

The slots available to the function.

blocks IReadOnlyList<IrBasicBlock>

The function basic blocks.

lifetimeRegions IReadOnlyList<IrLifetimeRegion>

The function lifetime regions.

IrFunction(string, TypeSymbol, int, IReadOnlyList<IrSlot>, IReadOnlyList<IrBasicBlock>, IReadOnlyList<IrLifetimeRegion>, IReadOnlyList<IrExceptionRegion>)

Represents an entry or user-defined function in portable MuLang IR.

public IrFunction(string Id, TypeSymbol ReturnType, int EntryBlock, IReadOnlyList<IrSlot> Slots, IReadOnlyList<IrBasicBlock> Blocks, IReadOnlyList<IrLifetimeRegion> LifetimeRegions, IReadOnlyList<IrExceptionRegion> ExceptionRegions)

Parameters

Id string

The function identifier.

ReturnType TypeSymbol

The declared return type.

EntryBlock int

The identifier of the entry block.

Slots IReadOnlyList<IrSlot>

The slots available to the function.

Blocks IReadOnlyList<IrBasicBlock>

The function basic blocks.

LifetimeRegions IReadOnlyList<IrLifetimeRegion>

The function lifetime regions.

ExceptionRegions IReadOnlyList<IrExceptionRegion>

The function exception regions.

Properties

Blocks

The function basic blocks.

public IReadOnlyList<IrBasicBlock> Blocks { get; init; }

Property Value

IReadOnlyList<IrBasicBlock>

EntryBlock

The identifier of the entry block.

public int EntryBlock { get; init; }

Property Value

int

ExceptionRegions

The function exception regions.

public IReadOnlyList<IrExceptionRegion> ExceptionRegions { get; init; }

Property Value

IReadOnlyList<IrExceptionRegion>

Id

The function identifier.

public string Id { get; init; }

Property Value

string

LifetimeRegions

The function lifetime regions.

public IReadOnlyList<IrLifetimeRegion> LifetimeRegions { get; init; }

Property Value

IReadOnlyList<IrLifetimeRegion>

ReturnType

The declared return type.

public TypeSymbol ReturnType { get; init; }

Property Value

TypeSymbol

Slots

The slots available to the function.

public IReadOnlyList<IrSlot> Slots { get; init; }

Property Value

IReadOnlyList<IrSlot>

Methods

Deconstruct(out string, out TypeSymbol, out int, out IReadOnlyList<IrSlot>, out IReadOnlyList<IrBasicBlock>)

Deconstructs the function using the legacy component shape.

[Obsolete("Use the deconstruction shape that includes lifetime and exception regions.")]
public void Deconstruct(out string Id, out TypeSymbol ReturnType, out int EntryBlock, out IReadOnlyList<IrSlot> Slots, out IReadOnlyList<IrBasicBlock> Blocks)

Parameters

Id string

The function identifier.

ReturnType TypeSymbol

The declared return type.

EntryBlock int

The identifier of the entry block.

Slots IReadOnlyList<IrSlot>

The slots available to the function.

Blocks IReadOnlyList<IrBasicBlock>

The function basic blocks.

Deconstruct(out string, out TypeSymbol, out int, out IReadOnlyList<IrSlot>, out IReadOnlyList<IrBasicBlock>, out IReadOnlyList<IrLifetimeRegion>, out IReadOnlyList<IrExceptionRegion>)

public void Deconstruct(out string Id, out TypeSymbol ReturnType, out int EntryBlock, out IReadOnlyList<IrSlot> Slots, out IReadOnlyList<IrBasicBlock> Blocks, out IReadOnlyList<IrLifetimeRegion> LifetimeRegions, out IReadOnlyList<IrExceptionRegion> ExceptionRegions)

Parameters

Id string
ReturnType TypeSymbol
EntryBlock int
Slots IReadOnlyList<IrSlot>
Blocks IReadOnlyList<IrBasicBlock>
LifetimeRegions IReadOnlyList<IrLifetimeRegion>
ExceptionRegions IReadOnlyList<IrExceptionRegion>

Equals(IrFunction?)

public bool Equals(IrFunction? other)

Parameters

other IrFunction

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

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

Parameters

left IrFunction
right IrFunction

Returns

bool

operator !=(IrFunction?, IrFunction?)

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

Parameters

left IrFunction
right IrFunction

Returns

bool