Builds out a LLZK-compliant module and provides utilities for populating that module.
More...
|
| | ModuleBuilder (mlir::ModuleOp m) |
| mlir::Region & | getBodyRegion () |
| mlir::ModuleOp & | getModule () |
| | Get the associated module of this builder.
|
| mlir::FailureOr< TemplateBuilder * > | getTemplate (std::string_view templateName) const |
| mlir::FailureOr< ModuleBuilder * > | getNestedModule (std::string_view moduleName) const |
| ModuleBuilder & | insertTemplate (std::string_view templateName, mlir::Location loc, unsigned numParams=0) |
| ModuleBuilder & | insertTemplate (std::string_view templateName, unsigned numParams=0) |
| ModuleBuilder & | insertNestedModule (std::string_view moduleName, mlir::Location loc) |
| ModuleBuilder & | insertNestedModule (std::string_view moduleName) |
| | ModuleLikeBuilder (mlir::MLIRContext *ctx) |
| mlir::Region & | getBodyRegion () |
| mlir::FailureOr< component::StructDefOp > | getStruct (std::string_view structName) const |
| mlir::FailureOr< function::FuncDefOp > | getComputeFn (std::string_view structName) const |
| mlir::FailureOr< function::FuncDefOp > | getConstrainFn (std::string_view structName) const |
| mlir::FailureOr< function::FuncDefOp > | getProductFn (std::string_view structName) const |
| mlir::FailureOr< function::FuncDefOp > | getFreeFunc (std::string_view funcName) const |
| ModuleBuilder & | insertEmptyStruct (std::string_view structName, mlir::Location loc) |
| ModuleBuilder & | insertComputeOnlyStruct (std::string_view structName, mlir::Location structLoc, mlir::Location computeLoc) |
| ModuleBuilder & | insertConstrainOnlyStruct (std::string_view structName, mlir::Location structLoc, mlir::Location constrainLoc) |
| ModuleBuilder & | insertFullStruct (std::string_view structName, mlir::Location structLoc, mlir::Location computeLoc, mlir::Location constrainLoc) |
| ModuleBuilder & | insertProductStruct (std::string_view structName, mlir::Location structLoc, mlir::Location productLoc) |
| ModuleBuilder & | insertComputeFn (component::StructDefOp op, mlir::Location loc) |
| ModuleBuilder & | insertConstrainFn (component::StructDefOp op, mlir::Location loc) |
| ModuleBuilder & | insertProductFn (component::StructDefOp op, mlir::Location loc) |
| ModuleBuilder & | insertComputeCall (component::StructDefOp caller, component::StructDefOp callee, mlir::Location callLoc) |
| | Only requirement for compute is the call itself.
|
| ModuleBuilder & | insertConstrainCall (component::StructDefOp caller, component::StructDefOp callee, mlir::Location callLoc, mlir::Location memberDefLoc) |
| | To call a constraint function, you must:
|
| ModuleBuilder & | insertFreeFunc (std::string_view funcName, ::mlir::FunctionType type, mlir::Location loc) |
| ModuleBuilder & | insertFreeCall (function::FuncDefOp caller, std::string_view callee, mlir::Location callLoc) |
| | BaseBuilder (mlir::MLIRContext *ctx) |
| mlir::Location | getUnknownLoc () |
|
| static function::FuncDefOp | buildComputeFn (component::StructDefOp op, mlir::Location loc) |
| | compute returns the type of the struct that defines it.
|
| static function::FuncDefOp | buildConstrainFn (component::StructDefOp op, mlir::Location loc) |
| | constrain accepts the struct type as the first argument.
|
| static function::FuncDefOp | buildProductFn (component::StructDefOp op, mlir::Location loc) |
| | product returns the type of the struct that defines it.
|
| void | ensureNoSuchFreeFunc (std::string_view funcName) |
| | Ensure that a global function with the given funcName has not been added, reporting a fatal error otherwise.
|
| void | ensureFreeFnExists (std::string_view funcName) |
| | Ensure that a global function with the given funcName has been added, reporting a fatal error otherwise.
|
| void | ensureNoSuchStruct (std::string_view structName) |
| | Ensure that a struct with the given structName has not been added, reporting a fatal error otherwise.
|
| void | ensureStructExists (std::string_view structName) |
| | Ensure that a struct with the given structName exists, reporting a fatal error otherwise.
|
| void | ensureNoSuchComputeFn (std::string_view structName) |
| | Ensure that the given struct does not have a compute function, reporting a fatal error otherwise.
|
| void | ensureComputeFnExists (std::string_view structName) |
| | Ensure that the given struct has a compute function, reporting a fatal error otherwise.
|
| void | ensureNoSuchConstrainFn (std::string_view structName) |
| | Ensure that the given struct does not have a constrain function, reporting a fatal error otherwise.
|
| void | ensureConstrainFnExists (std::string_view structName) |
| | Ensure that the given struct has a constrain function, reporting a fatal error otherwise.
|
| void | ensureNoSuchProductFn (std::string_view structName) |
| | Ensure that the given struct does not have a product function, reporting a fatal error otherwise.
|
| void | ensureProductFnExists (std::string_view structName) |
| | Ensure that the given struct has a product function, reporting a fatal error otherwise.
|
| std::unordered_map< std::string_view, function::FuncDefOp > | freeFuncMap |
| std::unordered_map< std::string_view, component::StructDefOp > | structMap |
| std::unordered_map< std::string_view, function::FuncDefOp > | computeFnMap |
| std::unordered_map< std::string_view, function::FuncDefOp > | constrainFnMap |
| std::unordered_map< std::string_view, function::FuncDefOp > | productFnMap |
| mlir::MLIRContext * | context |
Builds out a LLZK-compliant module and provides utilities for populating that module.
This class is designed to be used by front-ends looking to generate LLZK IR programmatically and is also a useful unit testing facility.
Definition at line 323 of file Builders.h.