Class NamedInstructionBuilder
A named instruction in a mutable control-flow graph builder.
Implements
Inherited Members
Namespace: Flame.Compiler
Assembly: Flame.Compiler.dll
Syntax
public sealed class NamedInstructionBuilder : InstructionBuilder, IEquatable<NamedInstructionBuilder>
Properties
| Edit this page View SourceBlock
Gets the basic block that defines this instruction.
Declaration
public override BasicBlockBuilder Block { get; }
Property Value
| Type | Description |
|---|---|
| BasicBlockBuilder | A basic block builder. |
Overrides
| Edit this page View SourceGraph
Gets the control-flow graph builder that defines this instruction.
Declaration
public override FlowGraphBuilder Graph { get; }
Property Value
| Type | Description |
|---|---|
| FlowGraphBuilder | A control-flow graph builder. |
Overrides
| Edit this page View SourceInstruction
Gets the actual instruction behind this instruction selector.
Declaration
public override Instruction Instruction { get; set; }
Property Value
| Type | Description |
|---|---|
| Instruction | The instruction. |
Overrides
| Edit this page View SourceInstructionIndex
Gets the index of this instruction in the defining block's list of instructions.
Declaration
public int InstructionIndex { get; }
Property Value
| Type | Description |
|---|---|
| int | The instruction index. |
IsValid
Tells if this instruction builder is still valid, that is, it has not been removed from its control-flow graph builder's set of instructions.
Declaration
public override bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Overrides
| Edit this page View SourceNextInstructionOrNull
Gets the next instruction in the basic block that defines this instruction. Returns null if there is no such instruction.
Declaration
public NamedInstructionBuilder NextInstructionOrNull { get; }
Property Value
| Type | Description |
|---|---|
| NamedInstructionBuilder | The next instruction or null. |
PreviousInstructionOrNull
Gets the previous instruction in the basic block that defines this instruction. Returns null if there is no such instruction.
Declaration
public NamedInstructionBuilder PreviousInstructionOrNull { get; }
Property Value
| Type | Description |
|---|---|
| NamedInstructionBuilder | The previous instruction or null. |
Tag
Gets this instruction's tag.
Declaration
public ValueTag Tag { get; }
Property Value
| Type | Description |
|---|---|
| ValueTag | The instruction's tag. |
Methods
| Edit this page View SourceEquals(NamedInstructionBuilder)
Tests if this instruction builder is the same instruction as another instruction builder.
Declaration
public bool Equals(NamedInstructionBuilder other)
Parameters
| Type | Name | Description |
|---|---|---|
| NamedInstructionBuilder | other | The other instruction builder. |
Returns
| Type | Description |
|---|---|
| bool |
|
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceInsertAfter(Instruction)
Inserts a particular instruction just after this instruction. Returns the inserted instruction builder.
Declaration
public NamedInstructionBuilder InsertAfter(Instruction instruction)
Parameters
| Type | Name | Description |
|---|---|---|
| Instruction | instruction | The instruction to insert. |
Returns
| Type | Description |
|---|---|
| NamedInstructionBuilder | The inserted instruction. |
InsertAfter(Instruction, ValueTag)
Inserts a particular instruction just after this instruction. Returns the inserted instruction builder.
Declaration
public NamedInstructionBuilder InsertAfter(Instruction instruction, ValueTag tag)
Parameters
| Type | Name | Description |
|---|---|---|
| Instruction | instruction | The instruction to insert. |
| ValueTag | tag | The tag to assign to the instruction. |
Returns
| Type | Description |
|---|---|
| NamedInstructionBuilder | The inserted instruction. |
InsertAfter(Instruction, string)
Inserts a particular instruction just after this instruction. Returns the inserted instruction builder.
Declaration
public NamedInstructionBuilder InsertAfter(Instruction instruction, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Instruction | instruction | The instruction to insert. |
| string | name | The preferred name for the instruction. |
Returns
| Type | Description |
|---|---|
| NamedInstructionBuilder | The inserted instruction. |
InsertBefore(Instruction, ValueTag)
Inserts a particular instruction just before this instruction. Returns the inserted instruction builder.
Declaration
public override NamedInstructionBuilder InsertBefore(Instruction instruction, ValueTag tag)
Parameters
| Type | Name | Description |
|---|---|---|
| Instruction | instruction | The instruction to insert. |
| ValueTag | tag | The tag to assign to the instruction. |
Returns
| Type | Description |
|---|---|
| NamedInstructionBuilder | The inserted instruction. |
Overrides
| Edit this page View SourceMoveTo(BasicBlockTag)
Moves this instruction from its current location to a the end of a basic block.
Declaration
public void MoveTo(BasicBlockTag block)
Parameters
| Type | Name | Description |
|---|---|---|
| BasicBlockTag | block | The block to move this instruction to. |
MoveTo(int, BasicBlockTag)
Moves this instruction from its current location to a particular position in a block.
Declaration
public void MoveTo(int index, BasicBlockTag block)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The position in |
| BasicBlockTag | block | The block to move this instruction to. |
ReplaceInstruction(FlowGraph, IReadOnlyList<ValueTag>)
Replaces this instruction with a control-flow graph that implements this instruction.
Declaration
public override void ReplaceInstruction(FlowGraph implementation, IReadOnlyList<ValueTag> arguments)
Parameters
| Type | Name | Description |
|---|---|---|
| FlowGraph | implementation | A control-flow graph that implements the instruction. |
| IReadOnlyList<ValueTag> | arguments | A list of arguments to pass to |
Overrides
| Edit this page View SourceToImmutable()
Gets an immutable version of this instruction, that is, this instruction but selected in an immutable version of the current state of the IR builder.
Declaration
public NamedInstruction ToImmutable()
Returns
| Type | Description |
|---|---|
| NamedInstruction | An immutable version. |
Operators
| Edit this page View Sourceimplicit operator ValueTag(NamedInstructionBuilder)
Implicitly converts an instruction to its tag.
Declaration
public static implicit operator ValueTag(NamedInstructionBuilder instruction)
Parameters
| Type | Name | Description |
|---|---|---|
| NamedInstructionBuilder | instruction | The instruction to convert. |
Returns
| Type | Description |
|---|---|
| ValueTag |