CIRCT
20.0.0git
|
This class represents a reference to a specific field or element of an aggregate value. More...
#include <FieldRef.h>
Public Member Functions | |
FieldRef () | |
Get a null FieldRef. More... | |
FieldRef (Value value, unsigned id) | |
Get a FieldRef location for the specified value. More... | |
Value | getValue () const |
Get the Value which created this location. More... | |
Operation * | getDefiningOp () const |
Get the operation which defines this field. More... | |
template<typename OpTy > | |
OpTy | getDefiningOp () const |
Get the operation which defines this field and cast it to the OpTy. More... | |
template<typename... Any> | |
bool | isa () const |
unsigned | getFieldID () const |
Get the field ID of this FieldRef, which is a unique identifier mapped to a specific field in a bundle. More... | |
FieldRef | getSubField (unsigned subFieldID) const |
Get a reference to a subfield. More... | |
Location | getLoc () const |
Get the location associated with the value of this field ref. More... | |
bool | operator== (const FieldRef &other) const |
bool | operator< (const FieldRef &other) const |
operator bool () const | |
Private Attributes | |
Value | value |
A pointer to the value which created this. More... | |
unsigned | id = 0 |
A unique field ID. More... | |
This class represents a reference to a specific field or element of an aggregate value.
Typically, the user will assign a unique field ID to each field in an aggregate type by visiting them in a depth-first pre-order.
This can be used as the key in a hashtable to store field specific information.
Definition at line 28 of file FieldRef.h.
|
inline |
|
inline |
Get a FieldRef location for the specified value.
Definition at line 34 of file FieldRef.h.
Operation * FieldRef::getDefiningOp | ( | ) | const |
Get the operation which defines this field.
If the field is a block argument it will return the operation which owns the block.
Definition at line 19 of file FieldRef.cpp.
References value.
Referenced by getDefiningOp(), and isa().
|
inline |
Get the operation which defines this field and cast it to the OpTy.
Returns null if the defining operation is of a different type.
Definition at line 46 of file FieldRef.h.
References getDefiningOp().
|
inline |
Get the field ID of this FieldRef, which is a unique identifier mapped to a specific field in a bundle.
Definition at line 59 of file FieldRef.h.
References id.
Referenced by getFieldIDOffset(), circt::firrtl::getFieldName(), getFieldName(), circt::firrtl::getTargetFor(), circt::hash_value(), isUselessVec(), and circt::firrtl::walkDrivers().
|
inline |
Get the location associated with the value of this field ref.
Definition at line 67 of file FieldRef.h.
References getValue().
|
inline |
Get a reference to a subfield.
Definition at line 62 of file FieldRef.h.
References FieldRef(), and value.
Referenced by DiscoverLoops::recordDataflow().
|
inline |
Get the Value which created this location.
Definition at line 37 of file FieldRef.h.
References value.
Referenced by DiscoverLoops::dfsTraverse(), getFieldIDOffset(), circt::firrtl::getFieldName(), getFieldName(), getLoc(), circt::firrtl::getTargetFor(), circt::hash_value(), isUselessVec(), and circt::firrtl::walkDrivers().
|
inline |
Definition at line 51 of file FieldRef.h.
References assert(), and getDefiningOp().
|
inline |
Definition at line 81 of file FieldRef.h.
References value.
|
inline |
Definition at line 73 of file FieldRef.h.
|
inline |
Definition at line 69 of file FieldRef.h.
|
private |
A unique field ID.
Definition at line 88 of file FieldRef.h.
Referenced by getFieldID(), operator<(), and operator==().
|
private |
A pointer to the value which created this.
Definition at line 85 of file FieldRef.h.
Referenced by getDefiningOp(), getSubField(), getValue(), operator bool(), operator<(), operator==(), and Python.support.OpOperand::type().