Show / Hide Table of Contents

    Class Branch

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

    Inheritance
    System.Object
    Branch
    Implements
    System.IEquatable<Branch>
    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 Branch : IEquatable<Branch>

    Constructors

    | Improve this Doc 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.

    | Improve this Doc 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.

    System.Collections.Generic.IReadOnlyList<BranchArgument> arguments

    A list of arguments to pass to the target block.

    | Improve this Doc 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.

    System.Collections.Generic.IReadOnlyList<ValueTag> arguments

    A list of arguments to pass to the target block.

    Properties

    | Improve this Doc 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
    System.Collections.Generic.IReadOnlyList<BranchArgument>

    A list of arguments.

    | Improve this Doc View Source

    Target

    Gets the branch's target block.

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

    The target block.

    Methods

    | Improve this Doc 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.

    | Improve this Doc 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.

    | Improve this Doc 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
    System.Boolean

    true if this branch equals the other branch; 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

    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
    System.Func<BranchArgument, BranchArgument> mapping

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

    Returns
    Type Description
    Branch

    A new branch.

    | Improve this Doc 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
    System.Func<ValueTag, ValueTag> mapping

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

    Returns
    Type Description
    Branch

    A new branch.

    | Improve this Doc 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
    System.Collections.Generic.IReadOnlyList<BranchArgument> arguments

    The new arguments.

    Returns
    Type Description
    Branch

    A new branch.

    | Improve this Doc 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.

    | Improve this Doc 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
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<ValueTag, BranchArgument>>

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

    | Improve this Doc 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
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<ValueTag, BranchArgument>>

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

    Operators

    | Improve this Doc View Source

    Equality(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
    System.Boolean

    true if the branches are equal; otherwise, false.

    | Improve this Doc View Source

    Inequality(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
    System.Boolean

    false if the branches are equal; otherwise, true.

    Implements

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