ILGPU  0.9.0
ILGPU.IR.Method Class Reference

Represents a method node within the IR. More...

Inheritance diagram for ILGPU.IR.Method:
ILGPU.IR.ValueParent ILGPU.IR.IMethodMappingObject ILGPU.IR.Analyses.ControlFlowDirection.IControlFlowAnalysisSource< Forwards > ILGPU.IR.IDumpable ILGPU.IR.Node ILGPU.IR.INode ILGPU.IR.ILocation ILGPU.IR.IDumpable

Classes

class  Builder
 A builder to build methods. More...
 
class  MethodLocation
 Represents a location that is bound to a managed method. More...
 
struct  MethodMapping
 Represents a method mapping. More...
 
struct  ParameterCollection
 Represents a readonly view on all parameters. More...
 
struct  ParameterMapping
 Represents a parameter mapping. More...
 

Public Member Functions

BasicBlock FindExitBlock ()
 Computes the exit block. More...
 
ParameterMapping CreateParameterMapping (in ReadOnlySpan< ValueReference > arguments)
 Creates a new parameter mapping. More...
 
override void Dump (TextWriter textWriter)
 Dumps this method to the given text writer. More...
 
Builder CreateBuilder ()
 Creates a new builder for this method. More...
 
bool HasFlags (MethodFlags flags)
 Returns true if this method has the given method flags. More...
 
void AddFlags (MethodFlags flags)
 Adds the given flags to this method. More...
 
void RemoveFlags (MethodFlags flags)
 Removes the given flags from this method. More...
 
bool HasTransformationFlags (MethodTransformationFlags flags)
 Returns true if this method has the given transformation flags. More...
 
void AddTransformationFlags (MethodTransformationFlags flags)
 Adds the given flags to this method. More...
 
void RemoveTransformationFlags (MethodTransformationFlags flags)
 Removes the given flags from this method. More...
 
- Public Member Functions inherited from ILGPU.IR.Node
virtual string FormatErrorMessage (string message)
 Formats an error message to include specific exception information. More...
 
string ToReferenceString ()
 Returns the string representation of this node as reference. More...
 
override string ToString ()
 Returns the string representation of this node. More...
 
- Public Member Functions inherited from ILGPU.IR.Analyses.ControlFlowDirection.IControlFlowAnalysisSource< Forwards >
BasicBlock FindExitBlock ()
 Computes the exit block. More...
 

Static Public Member Functions

static MethodFlags ResolveMethodFlags (MethodBase methodBase)
 Resolves MethodFlags that represents properties of the given method base. More...
 

Public Attributes

string Name => Declaration.Handle.ToString()
 Returns the associated method name. More...
 
MethodFlags Flags => Declaration.Flags
 Returns the associated method flags. More...
 
MethodHandle Handle => Declaration.Handle
 Returns the associated method handle. More...
 
MethodBase Source => Declaration.Source
 Returns the original source method (may be null). More...
 
bool HasSource => Declaration.HasSource
 Returns true if the associated source method is not null. More...
 
TypeNode ReturnType => Declaration.ReturnType
 Returns the return-type of the method. More...
 
bool IsVoid => ReturnType.IsVoidType
 Returns true if the return type of the method is void. More...
 
bool HasImplementation
 Returns true if this method has an implementation (no intrinsic or external method). More...
 
MethodTransformationFlags TransformationFlags => transformationFlags
 Returns the current transformation flags. More...
 
ParameterCollection Parameters => new ParameterCollection(parameters)
 Returns all attached parameters. More...
 
int NumParameters => parameters.Length
 Returns the number of attached parameters. More...
 
BasicBlockCollection< ReversePostOrder, ForwardsBlocks
 Returns all attached blocks. More...
 
BasicBlockCollection< ReversePostOrder, Forwards >.ValueCollection Values
 Returns all attached values. More...
 
- Public Attributes inherited from ILGPU.IR.ValueParent
bool IsBasicBlock => this is BasicBlock
 Returns true if this parent container is a block. More...
 
bool IsMethod => this is Method
 Returns true if this container is method. More...
 

Protected Member Functions

override string ToPrefixString ()
 
- Protected Member Functions inherited from ILGPU.IR.ValueParent
 ValueParent (Location location)
 Constructs a new value parent. More...
 
- Protected Member Functions inherited from ILGPU.IR.Node
 Node (Location location)
 Constructs a new node that is marked as replaceable. More...
 
void InferLocation< T > (ReadOnlySpan< T > elements)
 Infers the location (if required) of the current node. More...
 

Properties

IRContext Context [get]
 Returns the associated IR context. More...
 
MethodDeclaration Declaration [get]
 Returns the associated method declaration. More...
 
BasicBlock EntryBlock [get]
 Returns the associated entry block. More...
 
Builder MethodBuilder [get]
 Returns the current builder. More...
 
- Properties inherited from ILGPU.IR.Node
Location Location [get]
 Returns the associated location. More...
 
NodeId Id [get]
 Returns the unique node id. More...
 
- Properties inherited from ILGPU.IR.INode
NodeId Id [get]
 Returns the unique node id. More...
 
Location Location [get]
 Returns the associated location. More...
 
- Properties inherited from ILGPU.IR.IMethodMappingObject
MethodHandle Handle [get]
 Returns the associated function handle. More...
 
MethodBase Source [get]
 Returns the original source method (may be null). More...
 
- Properties inherited from ILGPU.IR.Analyses.ControlFlowDirection.IControlFlowAnalysisSource< Forwards >
BasicBlock EntryBlock [get]
 Returns the entry block. More...
 

Detailed Description

Represents a method node within the IR.

Member Function Documentation

void ILGPU.IR.Method.AddFlags ( MethodFlags  flags)

Adds the given flags to this method.

Parameters
flagsThe flags to add.
void ILGPU.IR.Method.AddTransformationFlags ( MethodTransformationFlags  flags)

Adds the given flags to this method.

Parameters
flagsThe flags to add.
Builder ILGPU.IR.Method.CreateBuilder ( )

Creates a new builder for this method.

Returns
The created builder.
ParameterMapping ILGPU.IR.Method.CreateParameterMapping ( in ReadOnlySpan< ValueReference arguments)

Creates a new parameter mapping.

Parameters
argumentsThe argument values.
Returns
The created parameter mapping.
override void ILGPU.IR.Method.Dump ( TextWriter  textWriter)

Dumps this method to the given text writer.

Parameters
textWriterThe text writer.

Implements ILGPU.IR.IDumpable.

BasicBlock ILGPU.IR.Method.FindExitBlock ( )

Computes the exit block.

Returns
The exit block.
bool ILGPU.IR.Method.HasFlags ( MethodFlags  flags)

Returns true if this method has the given method flags.

Parameters
flagsThe flags to check.
Returns
True, if this method has the given method flags.
bool ILGPU.IR.Method.HasTransformationFlags ( MethodTransformationFlags  flags)

Returns true if this method has the given transformation flags.

Parameters
flagsThe flags to check.
Returns
True, if this method has the given transformation flags.
void ILGPU.IR.Method.RemoveFlags ( MethodFlags  flags)

Removes the given flags from this method.

Parameters
flagsThe flags to remove.
void ILGPU.IR.Method.RemoveTransformationFlags ( MethodTransformationFlags  flags)

Removes the given flags from this method.

Parameters
flagsThe flags to remove.
static MethodFlags ILGPU.IR.Method.ResolveMethodFlags ( MethodBase  methodBase)
static

Resolves MethodFlags that represents properties of the given method base.

Parameters
methodBaseThe method base.
Returns
The resolved method flags.
override string ILGPU.IR.Method.ToPrefixString ( )
protectedvirtual

Implements ILGPU.IR.Node.

Member Data Documentation

Initial value:
=>
new BasicBlockCollection<ReversePostOrder

Returns all attached blocks.

MethodFlags ILGPU.IR.Method.Flags => Declaration.Flags

Returns the associated method flags.

MethodHandle ILGPU.IR.Method.Handle => Declaration.Handle

Returns the associated method handle.

bool ILGPU.IR.Method.HasImplementation
Initial value:
=>
!HasFlags(MethodFlags.Intrinsic | MethodFlags.External)

Returns true if this method has an implementation (no intrinsic or external method).

bool ILGPU.IR.Method.HasSource => Declaration.HasSource

Returns true if the associated source method is not null.

bool ILGPU.IR.Method.IsVoid => ReturnType.IsVoidType

Returns true if the return type of the method is void.

string ILGPU.IR.Method.Name => Declaration.Handle.ToString()

Returns the associated method name.

int ILGPU.IR.Method.NumParameters => parameters.Length

Returns the number of attached parameters.

ParameterCollection ILGPU.IR.Method.Parameters => new ParameterCollection(parameters)

Returns all attached parameters.

TypeNode ILGPU.IR.Method.ReturnType => Declaration.ReturnType

Returns the return-type of the method.

MethodBase ILGPU.IR.Method.Source => Declaration.Source

Returns the original source method (may be null).

MethodTransformationFlags ILGPU.IR.Method.TransformationFlags => transformationFlags

Returns the current transformation flags.

BasicBlockCollection<ReversePostOrder, Forwards>.ValueCollection ILGPU.IR.Method.Values
Initial value:

Returns all attached values.

Property Documentation

IRContext ILGPU.IR.Method.Context
get

Returns the associated IR context.

MethodDeclaration ILGPU.IR.Method.Declaration
get

Returns the associated method declaration.

BasicBlock ILGPU.IR.Method.EntryBlock
get

Returns the associated entry block.

Builder ILGPU.IR.Method.MethodBuilder
get

Returns the current builder.


The documentation for this class was generated from the following files: