ILGPU  0.9.0
ILGPU.IR.Types.StructureType Class Reference

Represents a structure type. More...

Inheritance diagram for ILGPU.IR.Types.StructureType:
ILGPU.IR.Types.ObjectType ILGPU.IR.Types.TypeNode ILGPU.IR.Node ILGPU.IR.Types.ITypeNode ILGPU.IR.INode ILGPU.IR.INode ILGPU.IR.ILocation ILGPU.IR.IDumpable ILGPU.IR.ILocation ILGPU.IR.IDumpable

Classes

struct  Builder
 A structure type builder. More...
 
struct  Enumerator
 An enumerator to enumerate all nested fields in the structure type. More...
 
struct  OffsetCollection
 A readonly collection of all field offsets and paddings. More...
 
struct  VectorizableFieldCollection
 Contains all vectorizable field ranges in the scope of its parent type. More...
 

Public Member Functions

int GetOffset (FieldAccess fieldAccess)
 Gets a specific field offset in bytes from the beginning of the structure. More...
 
TypeNode Get< TTypeContext > (TTypeContext typeContext, FieldSpan span)
 Gets a nested type that corresponds to the given span. More...
 
StructureType ConvertFieldTypes< TTypeContext, TTypeConverter > (TTypeContext typeContext, TTypeConverter typeConverter)
 Converts all field types using the type converter provided. More...
 
Enumerator GetEnumerator ()
 Returns an enumerator to enumerate all fields in this type. More...
 
override int GetHashCode ()
 
override bool Equals (object obj)
 
override string ToString ()
 
- Public Member Functions inherited from ILGPU.IR.Types.TypeNode
bool HasFlags (TypeFlags typeFlags)
 Returns true if the given flags are set. More...
 
As< T > (ILocation location)
 Converts the current type to the given type T . More...
 
override string FormatErrorMessage (string message)
 Formats an error message to include the current debug information. More...
 
override int GetHashCode ()
 Returns the hash code of this type node. More...
 
override bool Equals (object obj)
 Returns true if the given object is equal to the current type. More...
 
override string ToString ()
 Returns the string representation of this node. More...
 
- Public Member Functions inherited from ILGPU.IR.Node
virtual void Dump (TextWriter textWriter)
 Dumps this method to the given text writer. More...
 
string ToReferenceString ()
 Returns the string representation of this node as reference. More...
 
override string ToString ()
 Returns the string representation of this node. More...
 

Static Public Member Functions

static int GetNumFields (TypeNode typeNode)
 Gets the number of fields of the given type. More...
 
- Static Public Member Functions inherited from ILGPU.IR.Types.TypeNode
static long Align (long offset, int fieldAlignment)
 Computes a properly aligned offset in bytes for the given field size. More...
 
static int Align (int offset, int fieldAlignment)
 Computes a properly aligned offset in bytes for the given field size. More...
 

Public Attributes

OffsetCollection Offsets => new OffsetCollection(this)
 Returns a readonly collection of all field offsets. More...
 
VectorizableFieldCollection VectorizableFields
 Returns a readonly collection of all vectorized field configurations. More...
 
int NumFields => Fields.Length
 Returns the number of associated fields. More...
 
TypeNode this[FieldAccess fieldAccess] => Fields[fieldAccess.Index]
 Returns the field type that corresponds to the given field access. More...
 
- Public Attributes inherited from ILGPU.IR.Types.TypeNode
Context Context => TypeContext.Context
 Returns the parent ILGPU context. More...
 
bool IsVoidType => this is VoidType
 Returns true if the current type is a VoidType. More...
 
bool IsStringType => this is StringType
 Returns true if the current type is a StringType. More...
 
bool IsPrimitiveType => this is PrimitiveType
 Returns true if the current type is a PrimitiveType. More...
 
bool IsViewOrPointerType => this is AddressSpaceType
 Returns true if the current type is a PointerType or a ViewType. More...
 
bool IsPointerType => this is PointerType
 Returns true if the current type is a PointerType. More...
 
bool IsViewType => this is ViewType
 Returns true if the current type is a ViewType. More...
 
bool IsObjectType => this is ObjectType
 Returns true if the current type is an ObjectType. More...
 
bool IsStructureType => this is StructureType
 Returns true if the current type is a StructureType. More...
 
bool IsArrayType => this is ArrayType
 Returns true if the current type is a ArrayType. More...
 
bool IsRootType
 Returns true if this type is a root object type. More...
 
BasicValueType BasicValueType
 Returns the basic value type. More...
 
bool IsLowered
 Returns true if this type corresponds to its lowered representation. More...
 
Type ManagedType => managedType # GetManagedType()
 The type representation in the managed world. More...
 

Protected Member Functions

override Type GetManagedType ()
 Creates a managed type that corresponds to this structure type. More...
 
override string ToPrefixString ()
 
- Protected Member Functions inherited from ILGPU.IR.Types.ObjectType
 ObjectType (IRTypeContext typeContext)
 Constructs a new object type. More...
 
- Protected Member Functions inherited from ILGPU.IR.Types.TypeNode
 TypeNode (IRTypeContext typeContext)
 Constructs a new type. More...
 
void AddFlags (TypeFlags typeFlags)
 Adds the given flags to the current type. 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

ImmutableArray< TypeNodeDirectFields [get]
 Returns the high-level fields stored in this structure type. More...
 
ImmutableArray< TypeNodeFields [get]
 Returns all associated fields. More...
 
- Properties inherited from ILGPU.IR.Types.TypeNode
IRTypeContext TypeContext [get]
 Returns the parent type context. More...
 
int Size [get, protected set]
 The size of the type in bytes (if the type is in its lowered representation). More...
 
int Alignment [get, protected set]
 The type alignment in bytes (if the type is in its lowered representation). More...
 
TypeFlags Flags [get]
 Returns all type flags. 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.Types.ITypeNode
Type ManagedType [get]
 The type representation in the managed world. More...
 

Detailed Description

Represents a structure type.

Member Function Documentation

StructureType ILGPU.IR.Types.StructureType.ConvertFieldTypes< TTypeContext, TTypeConverter > ( TTypeContext  typeContext,
TTypeConverter  typeConverter 
)

Converts all field types using the type converter provided.

Template Parameters
TTypeContextThe type context to use.
TTypeConverterThe type converter to use.
Parameters
typeContextThe type context instance to use.
typeConverterThe type converter instance to use.
Returns
Type Constraints
TTypeContext :IIRTypeContext 
TTypeConverter :ITypeConverter<TypeNode> 
override bool ILGPU.IR.Types.StructureType.Equals ( object  obj)

TypeNode ILGPU.IR.Types.StructureType.Get< TTypeContext > ( TTypeContext  typeContext,
FieldSpan  span 
)

Gets a nested type that corresponds to the given span.

Template Parameters
TTypeContextthe parent type context.
Parameters
typeContextThe type context.
spanThe span to slice.
Returns
The nested type.
Type Constraints
TTypeContext :IIRTypeContext 
TTypeContext :span.HasSpan 
TTypeContext :this 
TTypeContext :span.Access 
TTypeContext :span.Index 
TTypeContext :span.Span 
TTypeContext :NumFields 
TTypeContext :this 
TTypeContext :Slice 
TTypeContext :typeContext 
TTypeContext :span 
Enumerator ILGPU.IR.Types.StructureType.GetEnumerator ( )

Returns an enumerator to enumerate all fields in this type.

Returns
The enumerator.
override int ILGPU.IR.Types.StructureType.GetHashCode ( )

override Type ILGPU.IR.Types.StructureType.GetManagedType ( )
protectedvirtual

Creates a managed type that corresponds to this structure type.

Implements ILGPU.IR.Types.TypeNode.

static int ILGPU.IR.Types.StructureType.GetNumFields ( TypeNode  typeNode)
static

Gets the number of fields of the given type.

Parameters
typeNodeThe type.
Returns
The number of nested fields (or 1).
int ILGPU.IR.Types.StructureType.GetOffset ( FieldAccess  fieldAccess)

Gets a specific field offset in bytes from the beginning of the structure.

Parameters
fieldAccessThe field reference.
Returns
The field offset in bytes.
override string ILGPU.IR.Types.StructureType.ToPrefixString ( )
protectedvirtual

Implements ILGPU.IR.Node.

override string ILGPU.IR.Types.StructureType.ToString ( )

Member Data Documentation

int ILGPU.IR.Types.StructureType.NumFields => Fields.Length

Returns the number of associated fields.

OffsetCollection ILGPU.IR.Types.StructureType.Offsets => new OffsetCollection(this)

Returns a readonly collection of all field offsets.

TypeNode ILGPU.IR.Types.StructureType.this[FieldAccess fieldAccess] => Fields[fieldAccess.Index]

Returns the field type that corresponds to the given field access.

Parameters
fieldAccessThe field access.
Returns
The resolved field type.
VectorizableFieldCollection ILGPU.IR.Types.StructureType.VectorizableFields
Initial value:
=>
new VectorizableFieldCollection(this)

Returns a readonly collection of all vectorized field configurations.

Property Documentation

ImmutableArray<TypeNode> ILGPU.IR.Types.StructureType.DirectFields
get

Returns the high-level fields stored in this structure type.

ImmutableArray<TypeNode> ILGPU.IR.Types.StructureType.Fields
get

Returns all associated fields.


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