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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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 | 
|---|---|
| System.Int32 | 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 | 
|---|---|
| System.Boolean | 
  | 
      
Overrides
| Improve this Doc 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
| Improve this Doc 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 | 
|---|---|
| System.Boolean | 
  | 
      
Equals(Object)
Declaration
public override bool Equals(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | obj | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
Overrides
InsertAfter(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.  | 
      
| System.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
| Improve this Doc 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(Int32, 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 | 
|---|---|---|
| System.Int32 | 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.  | 
      
| System.Collections.Generic.IReadOnlyList<ValueTag> | arguments | A list of arguments to pass to   | 
      
Overrides
| Improve this Doc 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
| Improve this Doc View SourceImplicit(NamedInstructionBuilder to ValueTag)
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 |