21#include <mlir/Bytecode/BytecodeImplementation.h>
22#include <mlir/IR/DialectImplementation.h>
23#include <mlir/Support/LLVM.h>
25#include <llvm/ADT/TypeSwitch.h>
31#define GET_ATTRDEF_CLASSES
43LogicalResult verifyLlzkMainAttr(Operation *op, Attribute attr) {
44 ModuleOp moduleOp = llvm::dyn_cast<ModuleOp>(op);
46 return op->emitError().append(
48 ModuleOp::getOperationName(),
'\''
53 if (succeeded(mainStructTypeOpt)) {
55 SymbolTableCollection symbolTables;
56 return st.getDefinition(symbolTables, op);
66 return verifyLlzkMainAttr(op, attr.getValue());
71auto LLZKDialect::initialize() ->
void {
76 #define GET_ATTRDEF_LIST
85 addInterfaces<LLZKDialectBytecodeInterface<LLZKDialect>>();
::llvm::LogicalResult verifyOperationAttribute(::mlir::Operation *op, ::mlir::NamedAttribute attribute) override
Provides a hook for verifying dialect attributes attached to the given op.
FailureOr< StructType > getTypeFromLlzkMainAttr(ModuleOp op, Attribute attr)
constexpr char MAIN_ATTR_NAME[]
Name of the attribute on the top-level ModuleOp that specifies the type of the main struct.