Class IntrinsicPrototype
An instruction prototype for intrinsics: instructions that behave like calls but are not (necessarily) implemented as calls.
Various parts of a compiler recognize intrinsics relevant to them and ignore the others.
Inherited Members
Namespace: Flame.Compiler.Instructions
Assembly: Flame.Compiler.dll
Syntax
public sealed class IntrinsicPrototype : InstructionPrototype
Properties
| Improve this Doc View SourceName
Gets this intrinsic's name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String | The intrinsic's name. |
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 SourceParameterTypes
Gets this intrinsic's parameter types.
Declaration
public IReadOnlyList<IType> ParameterTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IType> | The parameter types. |
ResultType
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(String, IType, IReadOnlyList<IType>)
Gets the intrinsic instruction prototype for a particular intrinsic name, return type and parameter type list.
Declaration
public static IntrinsicPrototype Create(string name, IType returnType, IReadOnlyList<IType> parameterTypes)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The intrinsic's name. |
IType | returnType | The type of value returned by the intrinsic. |
System.Collections.Generic.IReadOnlyList<IType> | parameterTypes | A list of the intrinsic's parameter types. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | An intrinsic instruction prototype. |
GetArgumentList(Instruction)
Gets the argument list in an instruction that conforms to this prototype.
Declaration
public IReadOnlyList<ValueTag> GetArgumentList(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | An instruction that conforms to this prototype. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<ValueTag> | The formal argument list. |
Instantiate(ValueTag[])
Instantiates this prototype with a list of arguments.
Declaration
public Instruction Instantiate(params ValueTag[] arguments)
Parameters
Type | Name | Description |
---|---|---|
ValueTag[] | arguments | The arguments to instantiate this prototype with. |
Returns
Type | Description |
---|---|
Instruction | An instruction whose prototype is equal to this prototype
and whose argument list is |
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. |