Show / Hide Table of Contents

    Class SwitchLowering

    A switch lowering transform, which rewrites general switch flow as if-else switch flow and jump table switch flow.

    Inheritance
    System.Object
    Optimization
    IntraproceduralOptimization
    SwitchLowering
    Inherited Members
    IntraproceduralOptimization.IsCheckpoint
    IntraproceduralOptimization.ApplyAsync(MethodBody, OptimizationState)
    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.Transforms
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class SwitchLowering : IntraproceduralOptimization

    Constructors

    | Improve this Doc View Source

    SwitchLowering(TypeEnvironment, Boolean, Boolean)

    Creates a switch lowering transform.

    Declaration
    public SwitchLowering(TypeEnvironment typeEnvironment, bool allowBitTests = true, bool allowJumpTables = true)
    Parameters
    Type Name Description
    TypeEnvironment typeEnvironment

    The type environment to use.

    System.Boolean allowBitTests

    Tells if it is permissible to generate bit tests.

    System.Boolean allowJumpTables

    Tells if it is permissible to generate jump tables.

    Properties

    | Improve this Doc View Source

    AllowBitTests

    Tells if it is permissible to generate bit tests.

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

    true if bit tests may be generated; otherwise, false.

    | Improve this Doc View Source

    AllowJumpTables

    Tells if it is permissible to generate jump tables.

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

    true if jump tables may be generated; otherwise, false.

    | Improve this Doc View Source

    TypeEnvironment

    Gets the type environment used by this switch lowering pass.

    Declaration
    public TypeEnvironment TypeEnvironment { get; }
    Property Value
    Type Description
    TypeEnvironment

    The type environment.

    Methods

    | Improve this Doc View Source

    Apply(FlowGraph)

    Lowers general switch flow in a particular flow graph.

    Declaration
    public override FlowGraph Apply(FlowGraph graph)
    Parameters
    Type Name Description
    FlowGraph graph

    The flow graph to rewrite.

    Returns
    Type Description
    FlowGraph

    A rewritten flow graph.

    Overrides
    IntraproceduralOptimization.Apply(FlowGraph)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX