Class ExceptionIntrinsics
Supports creating, recognizing and parsing exception handling intrinsics.
Inheritance
Inherited Members
Namespace: Flame.Compiler.Instructions
Assembly: Flame.Compiler.dll
Syntax
public static class ExceptionIntrinsics
Fields
| Improve this Doc View SourceNamespace
The namespace for exception handling intrinsics.
Declaration
public static readonly IntrinsicNamespace Namespace
Field Value
Type | Description |
---|---|
IntrinsicNamespace |
Methods
| Improve this Doc View SourceCreateCapturePrototype(IType, IType)
Creates a 'capture' instruction prototype, which captures a (thrown) exception.
Declaration
public static IntrinsicPrototype CreateCapturePrototype(IType resultType, IType argumentType)
Parameters
Type | Name | Description |
---|---|---|
IType | resultType | The type of a captured exception. |
IType | argumentType | The type of the exception to capture. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | A 'capture' instruction prototype. |
CreateGetCapturedExceptionPrototype(IType, IType)
Creates a 'get_captured_exception' instruction prototype, which extracts the exception captured by a captured exception.
Declaration
public static IntrinsicPrototype CreateGetCapturedExceptionPrototype(IType resultType, IType argumentType)
Parameters
Type | Name | Description |
---|---|---|
IType | resultType | The type of the exception value returned by this operation. |
IType | argumentType | The type of the captured exception to examine. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | A 'get_captured_exception' instruction prototype. |
CreatePrototype(String, IType, IReadOnlyList<IType>)
Creates an exception handling intrinsic prototype.
Declaration
public static IntrinsicPrototype CreatePrototype(string operatorName, IType resultType, IReadOnlyList<IType> parameterTypes)
Parameters
Type | Name | Description |
---|---|---|
System.String | operatorName | The name of the operator represented by the exception handling intrinsic. |
IType | resultType | The type of value produced by the intrinsic to create. |
System.Collections.Generic.IReadOnlyList<IType> | parameterTypes | The types of the values the intrinsic takes as arguments. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | An exception handling intrinsic prototype. |
CreateRethrowPrototype(IType)
Creates a 'rethrow' instruction prototype, which rethrows a captured exception. The difference between 'rethrow' and 'throw' is that the former takes a captured exception and retains stack trace information whereas the latter takes a (raw) exception value and constructs a new stack trace.
Declaration
public static IntrinsicPrototype CreateRethrowPrototype(IType capturedExceptionType)
Parameters
Type | Name | Description |
---|---|---|
IType | capturedExceptionType | The type of the captured exception to rethrow. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | A 'rethrow' intrinsic. |
CreateThrowPrototype(IType)
Creates a 'throw' instruction prototype, which throws an exception.
Declaration
public static IntrinsicPrototype CreateThrowPrototype(IType exceptionType)
Parameters
Type | Name | Description |
---|---|---|
IType | exceptionType | The type of exception to throw. |
Returns
Type | Description |
---|---|
IntrinsicPrototype | A 'throw' instruction prototype. |