Class NamedInstruction
A named instruction in the context of a control-flow graph.
Inheritance
Implements
Inherited Members
Namespace: Flame.Compiler
Assembly: Flame.Compiler.dll
Syntax
public sealed class NamedInstruction : IEquatable<NamedInstruction>
Properties
| Improve this Doc View SourceArguments
Gets the list of values this instruction takes as arguments.
Declaration
public IReadOnlyList<ValueTag> Arguments { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<ValueTag> |
Block
Gets the basic block that defines this named instruction.
Declaration
public BasicBlock Block { get; }
Property Value
Type | Description |
---|---|
BasicBlock | The basic block. |
Instruction
Gets the actual instruction behind this instruction selector.
Declaration
public Instruction Instruction { get; }
Property Value
Type | Description |
---|---|
Instruction | The instruction. |
InstructionIndex
Gets the index of this instruction in the defining block's list of instructions.
Declaration
public int InstructionIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The instruction index. |
NextInstructionOrNull
Gets the next instruction in the basic block that defines this instruction. Returns null if there is no such instruction.
Declaration
public NamedInstruction NextInstructionOrNull { get; }
Property Value
Type | Description |
---|---|
NamedInstruction | The next instruction or null. |
PreviousInstructionOrNull
Gets the previous instruction in the basic block that defines this instruction. Returns null if there is no such instruction.
Declaration
public NamedInstruction PreviousInstructionOrNull { get; }
Property Value
Type | Description |
---|---|
NamedInstruction | The previous instruction or null. |
Prototype
Gets the named instruction's prototype.
Declaration
public InstructionPrototype Prototype { get; }
Property Value
Type | Description |
---|---|
InstructionPrototype |
ResultType
Gets the named instruction's result type.
Declaration
public IType ResultType { get; }
Property Value
Type | Description |
---|---|
IType |
Tag
Gets the tag assigned to this instruction.
Declaration
public ValueTag Tag { get; }
Property Value
Type | Description |
---|---|
ValueTag | The instruction's tag. |
Methods
| Improve this Doc View SourceEquals(NamedInstruction)
Tests if this named instruction is the same instruction as another named instruction.
Declaration
public bool Equals(NamedInstruction other)
Parameters
Type | Name | Description |
---|---|---|
NamedInstruction | other | The other named instruction. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
InsertAfter(Instruction)
Inserts a particular instruction just after this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertAfter(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
InsertAfter(Instruction, ValueTag)
Inserts a particular instruction just after this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertAfter(Instruction instruction, ValueTag tag)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
ValueTag | tag | The instruction's tag. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
InsertAfter(Instruction, String)
Inserts a particular instruction just after this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertAfter(Instruction instruction, string name)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
System.String | name | The preferred name for the instruction. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
InsertBefore(Instruction)
Inserts a particular instruction just before this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertBefore(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
InsertBefore(Instruction, ValueTag)
Inserts a particular instruction just before this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertBefore(Instruction instruction, ValueTag tag)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
ValueTag | tag | The instruction's tag. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
InsertBefore(Instruction, String)
Inserts a particular instruction just before this instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction InsertBefore(Instruction instruction, string name)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The instruction to insert. |
System.String | name | The preferred name for the instruction. |
Returns
Type | Description |
---|---|
NamedInstruction | The inserted instruction in a new control-flow graph. |
ReplaceInstruction(FlowGraph)
Replaces this instruction with a control-flow graph that implements this instruction. The arity of the control-flow graph's entry point block must match this instruction's arity.
Declaration
public NamedInstruction ReplaceInstruction(FlowGraph implementation)
Parameters
Type | Name | Description |
---|---|---|
FlowGraph | implementation | A control-flow graph that implements the instruction. |
Returns
Type | Description |
---|---|
NamedInstruction | A new instruction in a new control-flow graph. |
ReplaceInstruction(Instruction)
Replaces this instruction with another instruction. Returns the new instruction in a new control-flow graph.
Declaration
public NamedInstruction ReplaceInstruction(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | The other instruction to replace this instruction with. |
Returns
Type | Description |
---|---|
NamedInstruction | A new instruction in a new control-flow graph. |
Operators
| Improve this Doc View SourceImplicit(NamedInstruction to ValueTag)
Implicitly converts an instruction to its tag.
Declaration
public static implicit operator ValueTag(NamedInstruction instruction)
Parameters
Type | Name | Description |
---|---|---|
NamedInstruction | instruction | The instruction to convert. |
Returns
Type | Description |
---|---|
ValueTag |