16 using namespace circt;
18 using namespace FieldIdImpl;
22 std::pair<Type, uint64_t> pair(type, fieldID);
24 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(pair.first))
25 pair = ftype.getSubTypeByFieldID(pair.second);
27 llvm::report_fatal_error(
"fieldID indexing into a non-aggregate type");
32 std::pair<Type, uint64_t>
36 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
37 return ftype.getSubTypeByFieldID(fieldID);
39 llvm::report_fatal_error(
"fieldID indexing into a non-aggregate type");
43 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
44 return ftype.getMaxFieldID();
48 std::pair<uint64_t, bool>
51 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
52 return ftype.projectToChildFieldID(fieldID, index);
53 return {0, fieldID == 0};
58 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
59 return ftype.getIndexForFieldID(fieldID);
64 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
65 return ftype.getFieldID(fieldID);
69 std::pair<uint64_t, uint64_t>
71 if (
auto ftype = dyn_cast<FieldIDTypeInterface>(type))
72 return ftype.getIndexAndSubfieldID(fieldID);
73 return {0, fieldID == 0};
76 #include "circt/Dialect/HW/HWTypeInterfaces.cpp.inc"
std::pair< uint64_t, uint64_t > getIndexAndSubfieldID(Type type, uint64_t fieldID)
uint64_t getFieldID(Type type, uint64_t index)
std::pair<::mlir::Type, uint64_t > getSubTypeByFieldID(Type, uint64_t fieldID)
std::pair< uint64_t, bool > projectToChildFieldID(Type, uint64_t fieldID, uint64_t index)
::mlir::Type getFinalTypeByFieldID(Type type, uint64_t fieldID)
uint64_t getIndexForFieldID(Type type, uint64_t fieldID)
uint64_t getMaxFieldID(Type)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.