LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::component Namespace Reference

Namespaces

namespace  detail
 Common interface for operations that read or write from a struct member.
namespace  impl

Classes

class  CreateStructOp
class  CreateStructOpAdaptor
class  CreateStructOpGenericAdaptor
struct  ExposeChildMembersPassOptions
struct  InlineStructsPassOptions
struct  InStructFunctionNamed
 This class provides a verifier for ops that are expecting to have an ancestor FuncDefOp with the given name. More...
class  MemberDefOp
class  MemberDefOpAdaptor
class  MemberDefOpGenericAdaptor
class  MemberReadOp
class  MemberReadOpAdaptor
class  MemberReadOpGenericAdaptor
class  MemberRefOpInterface
class  MemberWriteOp
class  MemberWriteOpAdaptor
class  MemberWriteOpGenericAdaptor
class  SetFuncAllowAttrs
 Only valid/implemented for StructDefOp. More...
class  StructDefOp
class  StructDefOpAdaptor
class  StructDefOpGenericAdaptor
class  StructDialect
 LLZK component/struct operations. More...
struct  StructDialectBytecodeInterface
 Implement version upgrade for StructDialect. More...
class  StructType

Functions

bool isInStruct (Operation *op)
FailureOr< StructDefOp > verifyInStruct (Operation *op)
bool isInStructFunctionNamed (Operation *op, char const *funcName)
InFlightDiagnostic genCompareErr (StructDefOp expected, Operation *origin, const char *aspect)
LogicalResult checkSelfType (SymbolTableCollection &tables, StructDefOp expectedStruct, Type actualType, Operation *origin, const char *aspect)
 Verifies that the given actualType matches the StructDefOp given (i.e., for the "self" type parameter and return of the struct functions).
std::unique_ptr<::mlir::Pass > createExposeChildMembersPass ()
std::unique_ptr<::mlir::Pass > createExposeChildMembersPass (ExposeChildMembersPassOptions options)
std::unique_ptr<::mlir::Pass > createInlineStructsPass ()
std::unique_ptr<::mlir::Pass > createInlineStructsPass (InlineStructsPassOptions options)
mlir::InFlightDiagnostic genCompareErr (StructDefOp expected, mlir::Operation *origin, const char *aspect)
mlir::LogicalResult checkSelfType (mlir::SymbolTableCollection &symbolTable, StructDefOp expectedStruct, mlir::Type actualType, mlir::Operation *origin, const char *aspect)
bool isInStruct (mlir::Operation *op)
 Return true iff the given Operation is nested somewhere within a StructDefOp.
mlir::FailureOr< StructDefOp > verifyInStruct (mlir::Operation *op)
 If the given Operation is nested somewhere within a StructDefOp, return a success result containing that StructDefOp.
bool isInStructFunctionNamed (mlir::Operation *op, char const *funcName)
 Return true iff the given Operation is contained within a FuncDefOp with the given name that is itself contained within a StructDefOp.
template<char const * FuncName, unsigned PrefixLen>
mlir::LogicalResult verifyInStructFunctionNamed (mlir::Operation *op, llvm::function_ref< llvm::SmallString< PrefixLen >()> prefix)
 Checks if the given Operation is contained within a FuncDefOp with the given name that is itself contained within a StructDefOp, producing an error if not.
mlir::LogicalResult exposeChildMembers (StructDefOp root)
 Make reachable concrete child members and matching rolled family declarations public while preserving root's visibility and all signal annotations.
void registerExposeChildMembersPass ()
void registerExposeChildMembersPassPass ()
void registerInlineStructsPass ()
void registerInlineStructsPassPass ()
void registerTransformationPasses ()

Function Documentation

◆ checkSelfType() [1/2]

mlir::LogicalResult llzk::component::checkSelfType ( mlir::SymbolTableCollection & symbolTable,
StructDefOp expectedStruct,
mlir::Type actualType,
mlir::Operation * origin,
const char * aspect )

◆ checkSelfType() [2/2]

LogicalResult llzk::component::checkSelfType ( SymbolTableCollection & tables,
StructDefOp expectedStruct,
Type actualType,
Operation * origin,
const char * aspect )

Verifies that the given actualType matches the StructDefOp given (i.e., for the "self" type parameter and return of the struct functions).

Definition at line 121 of file Ops.cpp.

◆ createExposeChildMembersPass() [1/2]

std::unique_ptr<::mlir::Pass > llzk::component::createExposeChildMembersPass ( )

Definition at line 108 of file ExposeChildMembersPass.cpp.

◆ createExposeChildMembersPass() [2/2]

std::unique_ptr<::mlir::Pass > llzk::component::createExposeChildMembersPass ( ExposeChildMembersPassOptions options)

Definition at line 112 of file ExposeChildMembersPass.cpp.

◆ createInlineStructsPass() [1/2]

std::unique_ptr<::mlir::Pass > llzk::component::createInlineStructsPass ( )

Definition at line 215 of file InlineStructsPass.cpp.

◆ createInlineStructsPass() [2/2]

std::unique_ptr<::mlir::Pass > llzk::component::createInlineStructsPass ( InlineStructsPassOptions options)

Definition at line 219 of file InlineStructsPass.cpp.

◆ exposeChildMembers()

LogicalResult llzk::component::exposeChildMembers ( StructDefOp root)

Make reachable concrete child members and matching rolled family declarations public while preserving root's visibility and all signal annotations.

Root must be attached to an LLZK module, with templates monomorphized and includes inlined. Emit diagnostics on failure without changing member visibility.

Definition at line 227 of file ExposeChildMembersPass.cpp.

◆ genCompareErr() [1/2]

mlir::InFlightDiagnostic llzk::component::genCompareErr ( StructDefOp expected,
mlir::Operation * origin,
const char * aspect )

◆ genCompareErr() [2/2]

InFlightDiagnostic llzk::component::genCompareErr ( StructDefOp expected,
Operation * origin,
const char * aspect )

Definition at line 99 of file Ops.cpp.

◆ isInStruct() [1/2]

bool llzk::component::isInStruct ( mlir::Operation * op)

Return true iff the given Operation is nested somewhere within a StructDefOp.

◆ isInStruct() [2/2]

bool llzk::component::isInStruct ( Operation * op)

Definition at line 57 of file Ops.cpp.

◆ isInStructFunctionNamed() [1/2]

bool llzk::component::isInStructFunctionNamed ( mlir::Operation * op,
char const * funcName )

Return true iff the given Operation is contained within a FuncDefOp with the given name that is itself contained within a StructDefOp.

◆ isInStructFunctionNamed() [2/2]

bool llzk::component::isInStructFunctionNamed ( Operation * op,
char const * funcName )

Definition at line 67 of file Ops.cpp.

◆ registerExposeChildMembersPass()

void llzk::component::registerExposeChildMembersPass ( )
inline

Definition at line 235 of file TransformationPasses.h.

◆ registerExposeChildMembersPassPass()

void llzk::component::registerExposeChildMembersPassPass ( )
inline

Definition at line 242 of file TransformationPasses.h.

◆ registerInlineStructsPass()

void llzk::component::registerInlineStructsPass ( )
inline

Definition at line 256 of file TransformationPasses.h.

◆ registerInlineStructsPassPass()

void llzk::component::registerInlineStructsPassPass ( )
inline

Definition at line 263 of file TransformationPasses.h.

◆ registerTransformationPasses()

void llzk::component::registerTransformationPasses ( )
inline

Definition at line 277 of file TransformationPasses.h.

◆ verifyInStruct() [1/2]

mlir::FailureOr< StructDefOp > llzk::component::verifyInStruct ( mlir::Operation * op)

If the given Operation is nested somewhere within a StructDefOp, return a success result containing that StructDefOp.

Otherwise emit an error and return a failure result.

◆ verifyInStruct() [2/2]

FailureOr< StructDefOp > llzk::component::verifyInStruct ( Operation * op)

Definition at line 59 of file Ops.cpp.

◆ verifyInStructFunctionNamed()

template<char const * FuncName, unsigned PrefixLen>
mlir::LogicalResult llzk::component::verifyInStructFunctionNamed ( mlir::Operation * op,
llvm::function_ref< llvm::SmallString< PrefixLen >()> prefix )

Checks if the given Operation is contained within a FuncDefOp with the given name that is itself contained within a StructDefOp, producing an error if not.

Definition at line 72 of file Ops.h.