13 #ifndef CIRCT_DIALECT_HW_HWOPINTERFACES_H
14 #define CIRCT_DIALECT_HW_HWOPINTERFACES_H
23 #include "mlir/IR/OpDefinition.h"
24 #include "mlir/IR/SymbolTable.h"
31 TypeConverter &converter);
33 class InnerSymbolOpInterface;
47 static bool classof(mlir::Operation *op);
49 static bool classof(
const mlir::RegisteredOperationName *opInfo);
60 template <
typename ConcreteType>
65 ConcreteType::template hasTrait<::mlir::OpTrait::SymbolTable>(),
66 "expected operation to be a SymbolTable");
68 if (op->getNumRegions() != 1)
69 return op->emitError(
"expected operation to have a single region");
70 if (!op->getRegion(0).hasOneBlock())
71 return op->emitError(
"expected operation to have a single block");
79 template <
typename ConcreteType>
86 ConcreteType::template hasTrait<::mlir::SymbolOpInterface::Trait>(),
87 "expected operation to define a Symbol");
90 auto *parent = op->getParentOp();
91 if (!parent || !isa<circt::hw::InnerRefNamespaceLike>(parent))
93 "InnerSymbolTable must have InnerRefNamespace parent");
101 #include "circt/Dialect/HW/HWOpInterfaces.h.inc"
This trait is for operations that define a scope for resolving InnerRef's, and provides verification ...
static LogicalResult verifyRegionTrait(Operation *op)
A trait for inner symbol table functionality on an operation.
static LogicalResult verifyRegionTrait(Operation *op)
LogicalResult verifyInnerRefNamespace(Operation *op)
void populateHWModuleLikeTypeConversionPattern(StringRef moduleLikeOpName, RewritePatternSet &patterns, TypeConverter &converter)
LogicalResult verifyInnerSymAttr(InnerSymbolOpInterface op)
Verification hook for verifying InnerSym Attribute.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Classify operations that are InnerRefNamespace-like, until structure is in place to do this via Trait...
static bool classof(mlir::Operation *op)
Return if this operation is explicitly an IRN or appears compatible.