Class BlockFlow
Describes control flow at the end of a basic block.
Inherited Members
Namespace: Flame.Compiler
Assembly: Flame.Compiler.dll
Syntax
public abstract class BlockFlow
Properties
| Improve this Doc View SourceBranches
Gets a list of branches this flow may take.
Declaration
public abstract IReadOnlyList<Branch> Branches { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Branch> | A list of potential branches. |
BranchTargets
Gets a list of each branch's target.
Declaration
public IEnumerable<BasicBlockTag> BranchTargets { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<BasicBlockTag> | A list of branch targets. |
Instructions
Gets a list of inner instructions for this block flow.
Declaration
public abstract IReadOnlyList<Instruction> Instructions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Instruction> | The inner instructions. |
Values
Gets a sequence of all values that are used in this block flow. Multiply used values are appropriately duplicated.
Declaration
public IEnumerable<ValueTag> Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ValueTag> | A sequence of values. |
Methods
| Improve this Doc View SourceGetInstructionBuilder(BasicBlockBuilder, Int32)
Gets an instruction builder for the nth anonymous instruction in this block flow.
Declaration
public abstract InstructionBuilder GetInstructionBuilder(BasicBlockBuilder block, int instructionIndex)
Parameters
Type | Name | Description |
---|---|---|
BasicBlockBuilder | block | The block that defines this flow. |
System.Int32 | instructionIndex | The index of the anonymous instruction to create a builder for. |
Returns
Type | Description |
---|---|
InstructionBuilder | An instruction builder for an anonymous instruction. |
GetInstructionBuilders(BasicBlockBuilder)
Gets instruction builders for all anonymous instructions in this block flow.
Declaration
public IEnumerable<InstructionBuilder> GetInstructionBuilders(BasicBlockBuilder block)
Parameters
Type | Name | Description |
---|---|---|
BasicBlockBuilder | block | The block that defines this flow. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<InstructionBuilder> | A sequence of instruction builders for anonymous instructions. |
MapArguments(IReadOnlyDictionary<BranchArgument, BranchArgument>)
Applies a mapping to all branch arguments in this flow.
Declaration
public BlockFlow MapArguments(IReadOnlyDictionary<BranchArgument, BranchArgument> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyDictionary<BranchArgument, BranchArgument> | mapping | A argument-to-argument mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapArguments(Func<BranchArgument, BranchArgument>)
Applies a mapping to all branch arguments in this flow.
Declaration
public BlockFlow MapArguments(Func<BranchArgument, BranchArgument> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Func<BranchArgument, BranchArgument> | mapping | A argument-to-argument mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapBlocks(IReadOnlyDictionary<BasicBlockTag, BasicBlockTag>)
Applies a mapping to all basic blocks referenced by branches in this block flow.
Declaration
public BlockFlow MapBlocks(IReadOnlyDictionary<BasicBlockTag, BasicBlockTag> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyDictionary<BasicBlockTag, BasicBlockTag> | mapping | A block-to-block mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapBlocks(Func<BasicBlockTag, BasicBlockTag>)
Applies a mapping to all basic blocks referenced by branches in this block flow.
Declaration
public BlockFlow MapBlocks(Func<BasicBlockTag, BasicBlockTag> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Func<BasicBlockTag, BasicBlockTag> | mapping | A block-to-block mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapBranches(Func<Branch, Branch>)
Applies a mapping to all branches in this basic block.
Declaration
public BlockFlow MapBranches(Func<Branch, Branch> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Branch, Branch> | mapping | The mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapValues(IReadOnlyDictionary<ValueTag, ValueTag>)
Applies a mapping to all values referenced by instructions and branches in this block flow.
Declaration
public BlockFlow MapValues(IReadOnlyDictionary<ValueTag, ValueTag> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyDictionary<ValueTag, ValueTag> | mapping | A value-to-value mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
MapValues(Func<ValueTag, ValueTag>)
Applies a mapping to all values referenced by instructions and branches in this block flow.
Declaration
public BlockFlow MapValues(Func<ValueTag, ValueTag> mapping)
Parameters
Type | Name | Description |
---|---|---|
System.Func<ValueTag, ValueTag> | mapping | A value-to-value mapping to apply. |
Returns
Type | Description |
---|---|
BlockFlow | Block flow. |
WithBranches(IReadOnlyList<Branch>)
Replaces this flow's branches with a particular list of branches.
Declaration
public abstract BlockFlow WithBranches(IReadOnlyList<Branch> branches)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<Branch> | branches | The new branches. |
Returns
Type | Description |
---|---|
BlockFlow | A new flow. |
WithInstructions(IReadOnlyList<Instruction>)
Replaces this flow's inner instructions.
Declaration
public abstract BlockFlow WithInstructions(IReadOnlyList<Instruction> instructions)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<Instruction> | instructions | The new instructions. |
Returns
Type | Description |
---|---|
BlockFlow | A new flow. |