15#ifndef CIRCT_SUPPORT_FIELDINFO_H
16#define CIRCT_SUPPORT_FIELDINFO_H
19#include "mlir/IR/AttrTypeSubElements.h"
20#include "mlir/IR/BuiltinAttributes.h"
21#include "mlir/IR/Types.h"
22#include "llvm/ADT/Hashing.h"
36 return llvm::hash_combine(fi.
name, fi.
type);
45 SmallVectorImpl<std::pair<llvm::SMLoc, StringAttr>> &duplicates);
58struct AttrTypeSubElementHandler<
circt::FieldInfo> {
60 AttrTypeImmediateSubElementWalker &walker) {
61 walker.walk(param.
name);
62 walker.walk(param.
type);
65 AttrSubElementReplacements &attrRepls,
66 TypeSubElementReplacements &typeRepls) {
67 return {cast<StringAttr>(attrRepls.take_front(1)[0]),
68 typeRepls.take_front(1)[0]};
static bool operator==(const ModulePort &a, const ModulePort &b)
static llvm::hash_code hash_value(const ModulePort &port)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
ParseResult parseFieldList(AsmParser &p, SmallVectorImpl< FieldInfo > &fields, SmallVectorImpl< std::pair< llvm::SMLoc, StringAttr > > &duplicates)
Parse a list of named fields within <>, e.g.
void printFieldList(AsmPrinter &p, ArrayRef< FieldInfo > fields)
Print a list of fields within <>, e.g. <foo: i7, bar: i8>.
A named and typed field of an aggregate type.
static circt::FieldInfo replace(const circt::FieldInfo ¶m, AttrSubElementReplacements &attrRepls, TypeSubElementReplacements &typeRepls)
static void walk(const circt::FieldInfo ¶m, AttrTypeImmediateSubElementWalker &walker)