Search Results for

    Show / Hide Table of Contents

    Class Branch

    A branch to a particular block that passes a list of values as arguments.

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

    Constructors

    | Edit this page View Source

    Branch(BasicBlockTag)

    Creates a branch that targets a particular block and passes no arguments.

    Declaration
    public Branch(BasicBlockTag target)
    Parameters
    Type Name Description
    BasicBlockTag target

    The target block.

    | Edit this page View Source

    Branch(BasicBlockTag, IReadOnlyList<BranchArgument>)

    Creates a branch that targets a particular block and passes a list of arguments.

    Declaration
    public Branch(BasicBlockTag target, IReadOnlyList<BranchArgument> arguments)
    Parameters
    Type Name Description
    BasicBlockTag target

    The target block.

    IReadOnlyList<BranchArgument> arguments

    A list of arguments to pass to the target block.

    | Edit this page View Source

    Branch(BasicBlockTag, IReadOnlyList<ValueTag>)

    Creates a branch that targets a particular block and passes a list of arguments.

    Declaration
    public Branch(BasicBlockTag target, IReadOnlyList<ValueTag> arguments)
    Parameters
    Type Name Description
    BasicBlockTag target

    The target block.

    IReadOnlyList<ValueTag> arguments

    A list of arguments to pass to the target block.

    Properties

    | Edit this page View Source

    Arguments

    Gets the arguments passed to the target block when this branch is taken.

    Declaration
    public IReadOnlyList<BranchArgument> Arguments { get; }
    Property Value
    Type Description
    IReadOnlyList<BranchArgument>

    A list of arguments.

    | Edit this page View Source

    Target

    Gets the branch's target block.

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

    The target block.

    Methods

    | Edit this page View Source

    AddArgument(BranchArgument)

    Creates a branch that is the result of appending an argument at the end of this branch's argument list.

    Declaration
    public Branch AddArgument(BranchArgument argument)
    Parameters
    Type Name Description
    BranchArgument argument

    The argument to add.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    AddArgument(ValueTag)

    Creates a branch that is the result of appending an argument at the end of this branch's argument list.

    Declaration
    public Branch AddArgument(ValueTag argument)
    Parameters
    Type Name Description
    ValueTag argument

    The argument to add.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    Equals(Branch)

    Tests if this branch equals another branch.

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

    The branch to compare with.

    Returns
    Type Description
    bool

    true if this branch equals the other branch; otherwise, false.

    | Edit this page View Source

    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
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Edit this page View Source

    MapArguments(Func<BranchArgument, BranchArgument>)

    Creates a new branch by applying a mapping to every argument in this branch's argument list.

    Declaration
    public Branch MapArguments(Func<BranchArgument, BranchArgument> mapping)
    Parameters
    Type Name Description
    Func<BranchArgument, BranchArgument> mapping

    The mapping to apply to every argument in this branch's argument list.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    MapArguments(Func<ValueTag, ValueTag>)

    Creates a new branch by applying a mapping to every value in this branch's argument list.

    Declaration
    public Branch MapArguments(Func<ValueTag, ValueTag> mapping)
    Parameters
    Type Name Description
    Func<ValueTag, ValueTag> mapping

    The mapping to apply to every value in this branch's argument list.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    WithArguments(IReadOnlyList<BranchArgument>)

    Replaces this branch's arguments with a particular list of arguments.

    Declaration
    public Branch WithArguments(IReadOnlyList<BranchArgument> arguments)
    Parameters
    Type Name Description
    IReadOnlyList<BranchArgument> arguments

    The new arguments.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    WithTarget(BasicBlockTag)

    Replaces this branch's target with another block.

    Declaration
    public Branch WithTarget(BasicBlockTag target)
    Parameters
    Type Name Description
    BasicBlockTag target

    The new target block.

    Returns
    Type Description
    Branch

    A new branch.

    | Edit this page View Source

    ZipArgumentsWithParameters(FlowGraph)

    Zips this branch's arguments with their corresponding parameters.

    Declaration
    public IEnumerable<KeyValuePair<ValueTag, BranchArgument>> ZipArgumentsWithParameters(FlowGraph graph)
    Parameters
    Type Name Description
    FlowGraph graph

    The graph that defines the branch.

    Returns
    Type Description
    IEnumerable<KeyValuePair<ValueTag, BranchArgument>>

    A sequence of key-value pairs where the keys are basic block parameters and the values are branch arguments.

    | Edit this page View Source

    ZipArgumentsWithParameters(FlowGraphBuilder)

    Zips this branch's arguments with their corresponding parameters.

    Declaration
    public IEnumerable<KeyValuePair<ValueTag, BranchArgument>> ZipArgumentsWithParameters(FlowGraphBuilder graph)
    Parameters
    Type Name Description
    FlowGraphBuilder graph

    The graph that defines the branch.

    Returns
    Type Description
    IEnumerable<KeyValuePair<ValueTag, BranchArgument>>

    A sequence of key-value pairs where the keys are basic block parameters and the values are branch arguments.

    Operators

    | Edit this page View Source

    operator ==(Branch, Branch)

    Tests if two branches are equal.

    Declaration
    public static bool operator ==(Branch left, Branch right)
    Parameters
    Type Name Description
    Branch left

    The first branch to compare.

    Branch right

    The second branch to compare.

    Returns
    Type Description
    bool

    true if the branches are equal; otherwise, false.

    | Edit this page View Source

    operator !=(Branch, Branch)

    Tests if two branches are not equal.

    Declaration
    public static bool operator !=(Branch left, Branch right)
    Parameters
    Type Name Description
    Branch left

    The first branch to compare.

    Branch right

    The second branch to compare.

    Returns
    Type Description
    bool

    false if the branches are equal; otherwise, true.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX