Show / Hide Table of Contents

    Class BasicBlockBuilder

    A basic block in a mutable control-flow graph builder.

    Inheritance
    System.Object
    BasicBlockBuilder
    Implements
    System.IEquatable<BasicBlockBuilder>
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Compiler
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class BasicBlockBuilder : IEquatable<BasicBlockBuilder>

    Properties

    | Improve this Doc View Source

    Flow

    Gets or sets the control flow at the end of this basic block.

    Declaration
    public BlockFlow Flow { get; set; }
    Property Value
    Type Description
    BlockFlow

    The end-of-block control flow.

    | Improve this Doc View Source

    Graph

    Gets the control-flow graph builder that defines this basic block.

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

    The control-flow graph builder.

    | Improve this Doc View Source

    InstructionTags

    Gets the list of all instruction tags in this basic block.

    Declaration
    public ImmutableList<ValueTag> InstructionTags { get; }
    Property Value
    Type Description
    System.Collections.Immutable.ImmutableList<ValueTag>

    The list of all instruction tags.

    | Improve this Doc View Source

    IsEntryPoint

    Tells if this block is the graph's entry point.

    Declaration
    public bool IsEntryPoint { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsValid

    Tells if this basic block builder is still valid, that is, it has not been removed from its control-flow graph builder's set of basic blocks.

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

    true if this basic block builder is still valid; otherwise, false.

    | Improve this Doc View Source

    NamedInstructions

    Gets the list of all named instructions in this basic block.

    Declaration
    public IEnumerable<NamedInstructionBuilder> NamedInstructions { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<NamedInstructionBuilder>

    A sequence containing all named instructions.

    | Improve this Doc View Source

    Parameters

    Gets or sets this basic block's list of parameters.

    Declaration
    public ImmutableList<BlockParameter> Parameters { get; set; }
    Property Value
    Type Description
    System.Collections.Immutable.ImmutableList<BlockParameter>

    The basic block's parameters.

    | Improve this Doc View Source

    ParameterTags

    Gets a sequence of all parameter tags defined by this basic block.

    Declaration
    public IEnumerable<ValueTag> ParameterTags { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<ValueTag>

    The basic block's parameter tags.

    | Improve this Doc View Source

    Tag

    Gets this basic block's tag.

    Declaration
    public BasicBlockTag Tag { get; }
    Property Value
    Type Description
    BasicBlockTag

    The basic block's tag.

    Methods

    | Improve this Doc View Source

    AppendInstruction(Instruction)

    Appends a new instruction to the end of this basic block. Returns the instruction builder for the inserted instruction.

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

    The instruction to append.

    Returns
    Type Description
    NamedInstructionBuilder

    The appended instruction.

    | Improve this Doc View Source

    AppendInstruction(Instruction, ValueTag)

    Appends a new instruction to the end of this basic block. Returns the instruction builder for the inserted instruction.

    Declaration
    public NamedInstructionBuilder AppendInstruction(Instruction instruction, ValueTag tag)
    Parameters
    Type Name Description
    Instruction instruction

    The instruction to append.

    ValueTag tag

    The instruction's tag.

    Returns
    Type Description
    NamedInstructionBuilder

    The appended instruction.

    | Improve this Doc View Source

    AppendInstruction(Instruction, String)

    Appends a new instruction to the end of this basic block. Returns the instruction builder for the inserted instruction.

    Declaration
    public NamedInstructionBuilder AppendInstruction(Instruction instruction, string name)
    Parameters
    Type Name Description
    Instruction instruction

    The instruction to append.

    System.String name

    The preferred name of the instruction's tag.

    Returns
    Type Description
    NamedInstructionBuilder

    The appended instruction.

    | Improve this Doc View Source

    AppendParameter(BlockParameter)

    Appends a new parameter to the end of this basic block's parameter list.

    Declaration
    public BlockParameter AppendParameter(BlockParameter parameter)
    Parameters
    Type Name Description
    BlockParameter parameter

    The parameter to append.

    Returns
    Type Description
    BlockParameter

    The block parameter.

    | Improve this Doc View Source

    AppendParameter(IType)

    Appends a new parameter to the end of this basic block's parameter list.

    Declaration
    public BlockParameter AppendParameter(IType type)
    Parameters
    Type Name Description
    IType type

    The type of the parameter to append.

    Returns
    Type Description
    BlockParameter

    The block parameter.

    | Improve this Doc View Source

    AppendParameter(IType, ValueTag)

    Appends a new parameter to the end of this basic block's parameter list.

    Declaration
    public BlockParameter AppendParameter(IType type, ValueTag tag)
    Parameters
    Type Name Description
    IType type

    The type of the parameter to append.

    ValueTag tag

    The tag of the parameter to append.

    Returns
    Type Description
    BlockParameter

    The block parameter.

    | Improve this Doc View Source

    AppendParameter(IType, String)

    Appends a new parameter to the end of this basic block's parameter list.

    Declaration
    public BlockParameter AppendParameter(IType type, string name)
    Parameters
    Type Name Description
    IType type

    The type of the parameter to append.

    System.String name

    The name of the parameter to append.

    Returns
    Type Description
    BlockParameter

    The block parameter.

    | Improve this Doc View Source

    CopyInstructionsFrom(Int32, BasicBlock, IReadOnlyList<ValueTag>)

    Copies all instructions in a particular basic block into this basic block. All instructions defined by the block are renamed to avoid name clashes. References to the block's parameters are substituted by a list of arguments.

    Declaration
    public BlockFlow CopyInstructionsFrom(int insertionIndex, BasicBlock block, IReadOnlyList<ValueTag> arguments)
    Parameters
    Type Name Description
    System.Int32 insertionIndex

    The instruction at which to insert block's instructions.

    BasicBlock block

    The block to copy instructions from.

    System.Collections.Generic.IReadOnlyList<ValueTag> arguments

    The arguments to feed to the block.

    Returns
    Type Description
    BlockFlow

    block's flow, with values renamed to inserted instruction tags.

    | Improve this Doc View Source

    Equals(BasicBlockBuilder)

    Tests if this basic block equals another basic block.

    Declaration
    public bool Equals(BasicBlockBuilder other)
    Parameters
    Type Name Description
    BasicBlockBuilder other

    The other basic block.

    Returns
    Type Description
    System.Boolean

    true if this basic block equals the other basic block; otherwise, false.

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    InsertInstruction(Int32, Instruction)

    Appends a new instruction to the end of this basic block. Returns the instruction builder for the inserted instruction.

    Declaration
    public NamedInstructionBuilder InsertInstruction(int index, Instruction instruction)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert the instruction at.

    Instruction instruction

    The instruction to insert.

    Returns
    Type Description
    NamedInstructionBuilder

    The inserted instruction.

    | Improve this Doc View Source

    InsertInstruction(Int32, Instruction, ValueTag)

    Inserts a new instruction into this basic block's list of instructions. Returns the instruction builder for the inserted instruction.

    Declaration
    public NamedInstructionBuilder InsertInstruction(int index, Instruction instruction, ValueTag tag)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert the instruction at.

    Instruction instruction

    The instruction to insert.

    ValueTag tag

    The instruction's tag.

    Returns
    Type Description
    NamedInstructionBuilder

    The inserted instruction.

    | Improve this Doc View Source

    InsertInstruction(Int32, Instruction, String)

    Appends a new instruction to the end of this basic block. Returns the instruction builder for the inserted instruction.

    Declaration
    public NamedInstructionBuilder InsertInstruction(int index, Instruction instruction, string name)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert the instruction at.

    Instruction instruction

    The instruction to insert.

    System.String name

    The preferred name of the instruction's tag.

    Returns
    Type Description
    NamedInstructionBuilder

    The inserted instruction.

    | Improve this Doc View Source

    RemoveInstruction(ValueTag)

    Removes the instruction with a particular tag from this basic block.

    Declaration
    public void RemoveInstruction(ValueTag tag)
    Parameters
    Type Name Description
    ValueTag tag

    The tag of the instruction to remove.

    Operators

    | Improve this Doc View Source

    Implicit(BasicBlockBuilder to BasicBlockTag)

    Implicitly converts a block to its tag.

    Declaration
    public static implicit operator BasicBlockTag(BasicBlockBuilder block)
    Parameters
    Type Name Description
    BasicBlockBuilder block

    The block to convert.

    Returns
    Type Description
    BasicBlockTag

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX