Class AllocaArrayPrototype
A prototype for alloca-array instructions, which allocate a variable-length array of values on the stack.
Inherited Members
Namespace: Flame.Compiler.Instructions
Assembly: Flame.Compiler.dll
Syntax
public sealed class AllocaArrayPrototype : InstructionPrototype
Properties
| Improve this Doc View SourceElementType
Gets the type of element to allocate storage for.
Declaration
public IType ElementType { get; }
Property Value
Type | Description |
---|---|
IType | The type of element. |
ParameterCount
Gets the number of arguments this instruction takes when instantiated.
Declaration
public override int ParameterCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of arguments this instruction takes. |
Overrides
| Improve this Doc View SourceResultType
Gets the type of value produced instantiations of this prototype.
Declaration
public override IType ResultType { get; }
Property Value
Type | Description |
---|---|
IType | A type of value. |
Overrides
Methods
| Improve this Doc View SourceCheckConformance(Instruction, MethodBody)
Checks if a particular instance of this prototype conforms to the rules for this instruction prototype.
Declaration
public override IReadOnlyList<string> CheckConformance(Instruction instance, MethodBody body)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instance | An instance of this prototype. |
MethodBody | body | The method body that defines the instruction. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.String> | A list of conformance errors in the instruction. |
Overrides
| Improve this Doc View SourceCreate(IType)
Gets the alloca-array instruction prototype for a particular result type.
Declaration
public static AllocaArrayPrototype Create(IType resultType)
Parameters
Type | Name | Description |
---|---|---|
IType | resultType | The result type. |
Returns
Type | Description |
---|---|
AllocaArrayPrototype | An alloca-array instruction prototype. |
GetElementCount(Instruction)
Gets the number of elements allocated by an instance of this prototype.
Declaration
public ValueTag GetElementCount(Instruction instance)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instance | An alloca-array instruction. |
Returns
Type | Description |
---|---|
ValueTag | The number of elements allocated by the instruction. |
Instantiate(ValueTag)
Instantiates this prototype.
Declaration
public Instruction Instantiate(ValueTag elementCount)
Parameters
Type | Name | Description |
---|---|---|
ValueTag | elementCount | The number of elements to allocate storage for. |
Returns
Type | Description |
---|---|
Instruction | An alloca-array instruction. |
Map(MemberMapping)
Applies a member mapping to this instruction prototype.
Declaration
public override InstructionPrototype Map(MemberMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
MemberMapping | mapping | A member mapping. |
Returns
Type | Description |
---|---|
InstructionPrototype | A transformed instruction prototype. |