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);
33class InnerSymbolOpInterface;
45 llvm::function_ref<InFlightDiagnostic()> emitError);
48 llvm::function_ref<InFlightDiagnostic()> emitError) {
62 static bool classof(mlir::Operation *op);
64 static bool classof(
const mlir::RegisteredOperationName *opInfo);
75template <
typename ConcreteType>
80 ConcreteType::template hasTrait<::mlir::OpTrait::SymbolTable>(),
81 "expected operation to be a SymbolTable");
83 if (op->getNumRegions() != 1)
84 return op->emitError(
"expected operation to have a single region");
85 if (!op->getRegion(0).hasOneBlock())
86 return op->emitError(
"expected operation to have a single block");
89 return ::circt::hw::detail::verifyInnerRefNamespace(op);
94template <
typename ConcreteType>
101 ConcreteType::template hasTrait<::mlir::SymbolOpInterface::Trait>(),
102 "expected operation to define a Symbol");
105 auto *parent = op->getParentOp();
106 if (!parent || !isa<circt::hw::InnerRefNamespaceLike>(parent))
107 return op->emitError(
108 "InnerSymbolTable must have InnerRefNamespace parent");
111 return ::circt::hw::verifyPortInnerSymsIfPortList(op);
117#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)
LogicalResult verifyPortInnerSymsIfPortList(Operation *op)
Verification hook for verifying InnerSymbol-defining operations.
void populateHWModuleLikeTypeConversionPattern(StringRef moduleLikeOpName, RewritePatternSet &patterns, TypeConverter &converter)
LogicalResult verifyInnerSymAttr(InnerSymAttr innerSym, Type type, llvm::function_ref< InFlightDiagnostic()> emitError)
LogicalResult verifyInnerSymOp(InnerSymbolOpInterface op)
Verification hook for verifying InnerSymbol-defining operations.
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.