Class SwitchLowering
A switch lowering transform, which rewrites general switch flow as if-else switch flow and jump table switch flow.
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.Transforms
Assembly: Flame.Compiler.dll
Syntax
public sealed class SwitchLowering : IntraproceduralOptimization
Constructors
| Improve this Doc View SourceSwitchLowering(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 SourceAllowBitTests
Tells if it is permissible to generate bit tests.
Declaration
public bool AllowBitTests { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
AllowJumpTables
Tells if it is permissible to generate jump tables.
Declaration
public bool AllowJumpTables { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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 SourceApply(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. |