13 #ifndef CIRCT_SUPPORT_FIELDREF_H
14 #define CIRCT_SUPPORT_FIELDREF_H
17 #include "mlir/IR/Value.h"
18 #include "llvm/ADT/DenseMapInfo.h"
45 template <
typename OpTy>
50 template <
typename... Any>
53 assert(op &&
"isa<> used on a null type.");
54 return ::llvm::isa<Any...>(op);
81 operator bool()
const {
return bool(
value); }
assert(baseType &&"element must be base type")
This class represents a reference to a specific field or element of an aggregate value.
unsigned id
A unique field ID.
bool operator<(const FieldRef &other) const
FieldRef()
Get a null FieldRef.
FieldRef getSubField(unsigned subFieldID) const
Get a reference to a subfield.
unsigned getFieldID() const
Get the field ID of this FieldRef, which is a unique identifier mapped to a specific field in a bundl...
Value getValue() const
Get the Value which created this location.
Location getLoc() const
Get the location associated with the value of this field ref.
Operation * getDefiningOp() const
Get the operation which defines this field.
OpTy getDefiningOp() const
Get the operation which defines this field and cast it to the OpTy.
FieldRef(Value value, unsigned id)
Get a FieldRef location for the specified value.
bool operator==(const FieldRef &other) const
Value value
A pointer to the value which created this.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
inline ::llvm::hash_code hash_value(const FieldRef &fieldRef)
Get a hash code for a FieldRef.
size_t hash_combine(size_t h1, size_t h2)
C++'s stdlib doesn't have a hash_combine function. This is a simple one.
static circt::FieldRef getTombstoneKey()
static circt::FieldRef getEmptyKey()
static unsigned getHashValue(const circt::FieldRef &val)
static bool isEqual(const circt::FieldRef &lhs, const circt::FieldRef &rhs)