ILGPU  0.9.0
ILGPU.IR.Values.ValueReference Struct Reference

Represents a reference to a node that can be resolved automatically to the latest node information by following the replacement relation on nodes. More...

Inheritance diagram for ILGPU.IR.Values.ValueReference:
ILGPU.IR.IValue ILGPU.IR.INode ILGPU.IR.ILocation ILGPU.IR.IDumpable

Classes

struct  ToReferenceFormatter
 A value reference formatter. More...
 

Public Member Functions

 ValueReference (Value node)
 Constructs a new node reference. More...
 
ValueReference Refresh ()
 Refreshes the current reference and returns the new one. More...
 
ReadOnlySpan< ValueReference >.Enumerator GetEnumerator ()
 Returns an enumerator to enumerate all child nodes. More...
 
void Accept< T > (T visitor)
 Accepts a node visitor. More...
 
void Replace (Value other)
 Replaces this node with the given node. More...
 
Value Resolve ()
 Resolves the actual node with respect to replacement information. More...
 
ResolveAs< T > ()
 Resolves the actual node with respect to replacement information. More...
 
void Dump (TextWriter textWriter)
 Dumps this node to the given text writer. More...
 
string ILocation. FormatErrorMessage (string message)
 Formats an error message to include specific location information. More...
 
bool Equals (ValueReference other)
 Returns true if the given node reference points to the same node. More...
 
override bool Equals (object obj)
 Returns true if the given object is a node reference that points to the same node. More...
 
override int GetHashCode ()
 Returns the hash code of the directly associated node. More...
 
override string ToString ()
 Returns the string representation of this reference. More...
 

Static Public Member Functions

static implicit operator ValueReference (Value node)
 Converts the given node implicitly to a node reference. More...
 
static implicit operator Value (ValueReference reference)
 Converts the given reference to the latest node information. More...
 
static bool operator== (ValueReference first, ValueReference second)
 Returns true if the both node references point to the same node. More...
 
static bool operator!= (ValueReference first, ValueReference second)
 Returns true if the both node references point to different nodes. More...
 

Public Attributes

ValueKind ValueKind => Resolve().ValueKind
 Returns the current value kind. More...
 
bool IsValid => DirectTarget != null
 Returns true if the reference points to a valid node. More...
 
bool IsReplaced => IsValid && DirectTarget.IsReplaced
 Returns true if the direct target has been replaced. More...
 
BasicBlock BasicBlock => Resolve().BasicBlock
 Returns the parent basic block. More...
 
NodeId Id => Resolve().Id
 Returns the unique node id of the latest node. More...
 
Location Location => Resolve().Location
 Returns the associated location. More...
 
ReadOnlySpan< ValueReferenceNodes => Resolve().Nodes
 Returns all child nodes of the latest node. More...
 
UseCollection Uses => Resolve().Uses
 Returns all uses of the latest node. More...
 
TypeNode Type => Resolve().Type
 Returns the associated type of the latest node. More...
 
BasicValueType BasicValueType => Resolve().BasicValueType
 Returns the associated basic value type. More...
 

Properties

Value DirectTarget [get]
 Returns the node that is directly stored in the reference structure without using any replacement information. More...
 
- Properties inherited from ILGPU.IR.IValue
ValueKind ValueKind [get]
 Returns the current value kind. More...
 
TypeNode Type [get]
 Returns the associated type information. More...
 
BasicBlock BasicBlock [get]
 Returns the parent basic block. More...
 
BasicValueType BasicValueType [get]
 Returns the associated basic value type. More...
 
ReadOnlySpan< ValueReferenceNodes [get]
 Returns all associated nodes. More...
 
UseCollection Uses [get]
 Returns all associated uses. More...
 
- Properties inherited from ILGPU.IR.INode
NodeId Id [get]
 Returns the unique node id. More...
 
Location Location [get]
 Returns the associated location. More...
 

Detailed Description

Represents a reference to a node that can be resolved automatically to the latest node information by following the replacement relation on nodes.

Use the DirectTarget property to resolve the directly associated node.

Constructor & Destructor Documentation

ILGPU.IR.Values.ValueReference.ValueReference ( Value  node)

Constructs a new node reference.

Parameters
node

Member Function Documentation

void ILGPU.IR.Values.ValueReference.Accept< T > ( visitor)

Accepts a node visitor.

Template Parameters
TThe type of the visitor.
Parameters
visitorThe visitor.
Returns
The resulting value.

Implements ILGPU.IR.IValue.

Type Constraints
T :IValueVisitor 
T :Resolve() 
T :Accept 
T :visitor 
void ILGPU.IR.Values.ValueReference.Dump ( TextWriter  textWriter)

Dumps this node to the given text writer.

Parameters
textWriterThe text writer.

Implements ILGPU.IR.IDumpable.

bool ILGPU.IR.Values.ValueReference.Equals ( ValueReference  other)

Returns true if the given node reference points to the same node.

Parameters
otherThe other reference.
Returns
True, if the given reference points to the same node.
override bool ILGPU.IR.Values.ValueReference.Equals ( object  obj)

Returns true if the given object is a node reference that points to the same node.

Parameters
objThe other object.
Returns
True, if the given object points to the same node.
string ILocation. ILGPU.IR.Values.ValueReference.FormatErrorMessage ( string  message)

Formats an error message to include specific location information.

Implements ILGPU.IR.ILocation.

ReadOnlySpan<ValueReference>.Enumerator ILGPU.IR.Values.ValueReference.GetEnumerator ( )

Returns an enumerator to enumerate all child nodes.

Returns
An enumerator to enumerate all child nodes.
override int ILGPU.IR.Values.ValueReference.GetHashCode ( )

Returns the hash code of the directly associated node.

Returns
The hash code of the directly associated node
static implicit ILGPU.IR.Values.ValueReference.operator Value ( ValueReference  reference)
static

Converts the given reference to the latest node information.

Parameters
referenceThe reference to convert.
static implicit ILGPU.IR.Values.ValueReference.operator ValueReference ( Value  node)
static

Converts the given node implicitly to a node reference.

Parameters
nodeThe node to convert.
static bool ILGPU.IR.Values.ValueReference.operator!= ( ValueReference  first,
ValueReference  second 
)
static

Returns true if the both node references point to different nodes.

Parameters
firstThe first reference.
secondThe first reference.
Returns
True, if both node references point to different nodes.
static bool ILGPU.IR.Values.ValueReference.operator== ( ValueReference  first,
ValueReference  second 
)
static

Returns true if the both node references point to the same node.

Parameters
firstThe first reference.
secondThe first reference.
Returns
True, if both node references point to the same node.
ValueReference ILGPU.IR.Values.ValueReference.Refresh ( )

Refreshes the current reference and returns the new one.

Returns
The refreshed reference.
void ILGPU.IR.Values.ValueReference.Replace ( Value  other)

Replaces this node with the given node.

Parameters
otherThe other node.

Implements ILGPU.IR.IValue.

Value ILGPU.IR.Values.ValueReference.Resolve ( )

Resolves the actual node with respect to replacement information.

Returns
The actual node.

Implements ILGPU.IR.IValue.

T ILGPU.IR.Values.ValueReference.ResolveAs< T > ( )

Resolves the actual node with respect to replacement information.

Template Parameters
TThe target type.
Returns
The actual node.

Implements ILGPU.IR.IValue.

Type Constraints
T :Value 
T :Resolve() 
T :as 
T :T 
override string ILGPU.IR.Values.ValueReference.ToString ( )

Returns the string representation of this reference.

Returns
The string representation of this reference.

Member Data Documentation

BasicBlock ILGPU.IR.Values.ValueReference.BasicBlock => Resolve().BasicBlock

Returns the parent basic block.

BasicValueType ILGPU.IR.Values.ValueReference.BasicValueType => Resolve().BasicValueType

Returns the associated basic value type.

NodeId ILGPU.IR.Values.ValueReference.Id => Resolve().Id

Returns the unique node id of the latest node.

bool ILGPU.IR.Values.ValueReference.IsReplaced => IsValid && DirectTarget.IsReplaced

Returns true if the direct target has been replaced.

bool ILGPU.IR.Values.ValueReference.IsValid => DirectTarget != null

Returns true if the reference points to a valid node.

Location ILGPU.IR.Values.ValueReference.Location => Resolve().Location

Returns the associated location.

ReadOnlySpan<ValueReference> ILGPU.IR.Values.ValueReference.Nodes => Resolve().Nodes

Returns all child nodes of the latest node.

TypeNode ILGPU.IR.Values.ValueReference.Type => Resolve().Type

Returns the associated type of the latest node.

UseCollection ILGPU.IR.Values.ValueReference.Uses => Resolve().Uses

Returns all uses of the latest node.

ValueKind ILGPU.IR.Values.ValueReference.ValueKind => Resolve().ValueKind

Returns the current value kind.

Property Documentation

Value ILGPU.IR.Values.ValueReference.DirectTarget
get

Returns the node that is directly stored in the reference structure without using any replacement information.


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