Show / Hide Table of Contents

    Class InstructionBuilder

    A reference to an instruction in a control-flow graph, which can either be a named instruction that is defined directly by a basic block or an unnamed instruction included in a block's flow.

    This is a mutable reference: it refers to an instruction in a control-flow graph builder and that instruction can be changed.

    Inheritance
    System.Object
    InstructionBuilder
    FlowInstructionBuilder
    NamedInstructionBuilder
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Compiler
    Assembly: Flame.Compiler.dll
    Syntax
    public abstract class InstructionBuilder

    Properties

    | Improve this Doc View Source

    Arguments

    Gets or sets the instruction's argument list.

    Declaration
    public IReadOnlyList<ValueTag> Arguments { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<ValueTag>
    | Improve this Doc View Source

    Block

    Gets the block that defines this instruction.

    Declaration
    public abstract BasicBlockBuilder Block { get; }
    Property Value
    Type Description
    BasicBlockBuilder

    A basic block builder.

    | Improve this Doc View Source

    Graph

    Gets the graph that defines this instruction.

    Declaration
    public virtual FlowGraphBuilder Graph { get; }
    Property Value
    Type Description
    FlowGraphBuilder

    A control-flow graph builder.

    | Improve this Doc View Source

    Instruction

    Gets or sets the instruction referred to by this instruction builder.

    Declaration
    public abstract Instruction Instruction { get; set; }
    Property Value
    Type Description
    Instruction

    The instruction referred to by this builder.

    | Improve this Doc View Source

    IsValid

    Tells if this instruction builder is still valid. Querying or modifying invalid instruction builders results in an exception.

    Declaration
    public abstract bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instruction reference is valid; otherwise, false.

    | Improve this Doc View Source

    Prototype

    Gets the instruction's prototype.

    Declaration
    public InstructionPrototype Prototype { get; }
    Property Value
    Type Description
    InstructionPrototype
    | Improve this Doc View Source

    ResultType

    Gets the instruction's result type.

    Declaration
    public IType ResultType { get; }
    Property Value
    Type Description
    IType

    Methods

    | Improve this Doc View Source

    InsertBefore(Instruction)

    Inserts a particular instruction just before this instruction. Returns the inserted instruction builder.

    Declaration
    public NamedInstructionBuilder InsertBefore(Instruction instruction)
    Parameters
    Type Name Description
    Instruction instruction

    The instruction to insert.

    Returns
    Type Description
    NamedInstructionBuilder

    The inserted instruction.

    | Improve this Doc View Source

    InsertBefore(Instruction, ValueTag)

    Inserts a particular instruction just before this instruction. Returns the inserted instruction builder.

    Declaration
    public abstract 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.

    | Improve this Doc View Source

    InsertBefore(Instruction, String)

    Inserts a particular instruction just before this instruction. Returns the inserted instruction builder.

    Declaration
    public NamedInstructionBuilder InsertBefore(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.

    | Improve this Doc View Source

    ReplaceInstruction(FlowGraph)

    Replaces the instruction referred to by this instruction builder with a control-flow graph that implements the instruction. The instruction's arguments are passed to implementation's entry point block.

    Declaration
    public void ReplaceInstruction(FlowGraph implementation)
    Parameters
    Type Name Description
    FlowGraph implementation

    A control-flow graph that implements the instruction.

    Remarks

    Calling this method may invalidate instruction builders, including this builder. Specifically, if this builder refers to an unnamed instruction in block flow, then this builder and all other builders to unnamed instructions in that block flow may be invalidated.

    | Improve this Doc View Source

    ReplaceInstruction(FlowGraph, IReadOnlyList<ValueTag>)

    Replaces the instruction referred to by this instruction builder with a control-flow graph that implements the instruction.

    Declaration
    public abstract 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 implementation's entry point block.

    Remarks

    Calling this method may invalidate instruction builders, including this builder. Specifically, if this builder refers to an unnamed instruction in block flow, then this builder and all other builders to unnamed instructions in that block flow may be invalidated.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX