LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk::component::StructDefOp Class Reference
Inheritance diagram for llzk::component::StructDefOp:
[legend]
Collaboration diagram for llzk::component::StructDefOp:
[legend]

Public Types

using Adaptor = StructDefOpAdaptor
template<typename RangeT>
using GenericAdaptor = StructDefOpGenericAdaptor<RangeT>
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>
using Properties = FoldAdaptor::Properties

Public Member Functions

static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames ()
::mlir::StringAttr getSymNameAttrName ()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength (unsigned index)
::mlir::Operation::operand_range getODSOperands (unsigned index)
std::pair< unsigned, unsigned > getODSResultIndexAndLength (unsigned index)
::mlir::Operation::result_range getODSResults (unsigned index)
::mlir::Region & getBodyRegion ()
void writeProperties (::mlir::DialectBytecodeWriter &writer)
::mlir::StringAttr getSymNameAttr ()
::llvm::StringRef getSymName ()
void setSymNameAttr (::mlir::StringAttr attr)
void setSymName (::llvm::StringRef attrValue)
::llvm::LogicalResult verifyInvariantsImpl ()
::llvm::LogicalResult verifyInvariants ()
::llvm::LogicalResult verifyRegions ()
void print (::mlir::OpAsmPrinter &_odsPrinter)
StructType getType (::std::optional<::mlir::ArrayAttr > constParams={})
 Gets the StructType representing this struct.
StructType getType (::std::optional<::mlir::ArrayAttr > constParams={}) const
MemberDefOp getMemberDef (::mlir::StringAttr memberName)
 Gets the MemberDefOp that defines the member in this structure with the given name, if present.
::std::vector< MemberDefOp > getMemberDefs ()
 Get all MemberDefOp in this structure.
::mlir::LogicalResult hasColumns ()
 Returns whether the struct defines members marked as columns.
::mlir::LogicalResult hasSignals ()
 Returns whether the struct defines members marked as signals.
::llzk::function::FuncDefOp getComputeFuncOp ()
 Gets the FuncDefOp that defines the compute function in this structure, if present, or nullptr otherwise.
::llzk::function::FuncDefOp getConstrainFuncOp ()
 Gets the FuncDefOp that defines the constrain function in this structure, if present, or nullptr otherwise.
::llzk::function::FuncDefOp getProductFuncOp ()
 Gets the FuncDefOp that defines the product function in this structure, if present, or nullptr otherwise.
bool hasComputeConstrain ()
 Returns true iff this structure defines compute and constrain functions.
::std::string getHeaderString ()
 Generate header string, in the same format as the assemblyFormat.
bool hasTemplateSymbolBindings ()
 Return true iff the struct.def appears within a poly.template that defines constant parameters and/or expressions.
::llvm::SmallVector<::mlir::Attribute > getTemplateParamOpNames ()
 If this struct.def is within a poly.template, return names of all poly.param within the poly.template in the order they are defined.
::llvm::SmallVector<::mlir::Attribute > getTemplateExprOpNames ()
 If this struct.def is within a poly.template, return names of all poly.expr within the poly.template in the order they are defined.
::mlir::SymbolRefAttr getFullyQualifiedName ()
 Return the full name for this struct from the root module, including any surrounding module scopes.
bool isMainComponent ()
 Return true iff this struct.def is the main struct. See llzk::MAIN_ATTR_NAME.

Static Public Member Functions

::mlir::StringAttr getSymNameAttrName (::mlir::OperationName name)
static constexpr ::llvm::StringLiteral getOperationName ()
::llvm::LogicalResult setPropertiesFromAttr (Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Attribute getPropertiesAsAttr (::mlir::MLIRContext *ctx, const Properties &prop)
static llvm::hash_code computePropertiesHash (const Properties &prop)
static std::optional< mlir::Attribute > getInherentAttr (::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
static void setInherentAttr (Properties &prop, llvm::StringRef name, mlir::Attribute value)
static void populateInherentAttrs (::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::llvm::LogicalResult verifyInherentAttrs (::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult readProperties (::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
static void build (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name)
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name)
static void build (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name)
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name)
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name)
static void build (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name)
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name)
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name)
static void build (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name)
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name)
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name)
static void build (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute > attributes={})
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute > attributes={})
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute > attributes={})
static void build (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes={})
static StructDefOp create (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes={})
static StructDefOp create (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes={})
::mlir::ParseResult parse (::mlir::OpAsmParser &parser, ::mlir::OperationState &result)

Detailed Description

Definition at line 1345 of file Ops.h.inc.

Member Typedef Documentation

◆ Adaptor

◆ FoldAdaptor

using llzk::component::StructDefOp::FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>

Definition at line 1352 of file Ops.h.inc.

◆ GenericAdaptor

Definition at line 1351 of file Ops.h.inc.

◆ Properties

Member Function Documentation

◆ build() [1/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & ,
::mlir::OperationState & odsState,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute > attributes = {} )
static

Definition at line 1991 of file Ops.cpp.inc.

◆ build() [2/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & ,
::mlir::OperationState & odsState,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
const Properties & properties,
::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes = {} )
static

Definition at line 2023 of file Ops.cpp.inc.

◆ build() [3/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & odsBuilder,
::mlir::OperationState & odsState,
::llvm::StringRef sym_name )
static

Definition at line 1955 of file Ops.cpp.inc.

◆ build() [4/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & odsBuilder,
::mlir::OperationState & odsState,
::mlir::StringAttr sym_name )
static

Definition at line 1919 of file Ops.cpp.inc.

◆ build() [5/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & odsBuilder,
::mlir::OperationState & odsState,
::mlir::TypeRange resultTypes,
::llvm::StringRef sym_name )
static

Definition at line 1972 of file Ops.cpp.inc.

◆ build() [6/6]

void llzk::component::StructDefOp::build ( ::mlir::OpBuilder & odsBuilder,
::mlir::OperationState & odsState,
::mlir::TypeRange resultTypes,
::mlir::StringAttr sym_name )
static

Definition at line 1936 of file Ops.cpp.inc.

◆ computePropertiesHash()

llvm::hash_code llzk::component::StructDefOp::computePropertiesHash ( const Properties & prop)
static

Definition at line 1878 of file Ops.cpp.inc.

◆ create() [1/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::llvm::StringRef sym_name )
static

Definition at line 1968 of file Ops.cpp.inc.

◆ create() [2/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::mlir::StringAttr sym_name )
static

Definition at line 1932 of file Ops.cpp.inc.

◆ create() [3/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::mlir::TypeRange resultTypes,
::llvm::StringRef sym_name )
static

Definition at line 1987 of file Ops.cpp.inc.

◆ create() [4/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::mlir::TypeRange resultTypes,
::mlir::StringAttr sym_name )
static

Definition at line 1951 of file Ops.cpp.inc.

◆ create() [5/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute > attributes = {} )
static

Definition at line 2019 of file Ops.cpp.inc.

◆ create() [6/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::ImplicitLocOpBuilder & builder,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
const Properties & properties,
::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes = {} )
static

Definition at line 2042 of file Ops.cpp.inc.

◆ create() [7/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::llvm::StringRef sym_name )
static

Definition at line 1960 of file Ops.cpp.inc.

◆ create() [8/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::mlir::StringAttr sym_name )
static

Definition at line 1924 of file Ops.cpp.inc.

◆ create() [9/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::mlir::TypeRange resultTypes,
::llvm::StringRef sym_name )
static

Definition at line 1979 of file Ops.cpp.inc.

◆ create() [10/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::mlir::TypeRange resultTypes,
::mlir::StringAttr sym_name )
static

Definition at line 1943 of file Ops.cpp.inc.

◆ create() [11/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute > attributes = {} )
static

Definition at line 2011 of file Ops.cpp.inc.

◆ create() [12/12]

StructDefOp llzk::component::StructDefOp::create ( ::mlir::OpBuilder & builder,
::mlir::Location location,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
const Properties & properties,
::llvm::ArrayRef<::mlir::NamedAttribute > discardableAttributes = {} )
static

Definition at line 2034 of file Ops.cpp.inc.

◆ getAttributeNames()

::llvm::ArrayRef<::llvm::StringRef > llzk::component::StructDefOp::getAttributeNames ( )
inline

Definition at line 1354 of file Ops.h.inc.

◆ getBodyRegion()

::mlir::Region & llzk::component::StructDefOp::getBodyRegion ( )
inline

Definition at line 1391 of file Ops.h.inc.

◆ getComputeFuncOp()

FuncDefOp llzk::component::StructDefOp::getComputeFuncOp ( )

Gets the FuncDefOp that defines the compute function in this structure, if present, or nullptr otherwise.

Definition at line 466 of file Ops.cpp.

◆ getConstrainFuncOp()

FuncDefOp llzk::component::StructDefOp::getConstrainFuncOp ( )

Gets the FuncDefOp that defines the constrain function in this structure, if present, or nullptr otherwise.

Definition at line 470 of file Ops.cpp.

◆ getFullyQualifiedName()

SymbolRefAttr llzk::component::StructDefOp::getFullyQualifiedName ( )

Return the full name for this struct from the root module, including any surrounding module scopes.

Definition at line 218 of file Ops.cpp.

◆ getHeaderString()

std::string llzk::component::StructDefOp::getHeaderString ( )

Generate header string, in the same format as the assemblyFormat.

Definition at line 181 of file Ops.cpp.

◆ getInherentAttr()

std::optional< mlir::Attribute > llzk::component::StructDefOp::getInherentAttr ( ::mlir::MLIRContext * ctx,
const Properties & prop,
llvm::StringRef name )
static

Definition at line 1884 of file Ops.cpp.inc.

◆ getMemberDef()

MemberDefOp llzk::component::StructDefOp::getMemberDef ( ::mlir::StringAttr memberName)

Gets the MemberDefOp that defines the member in this structure with the given name, if present.

Definition at line 445 of file Ops.cpp.

◆ getMemberDefs()

std::vector< MemberDefOp > llzk::component::StructDefOp::getMemberDefs ( )

Get all MemberDefOp in this structure.

Definition at line 456 of file Ops.cpp.

◆ getODSOperandIndexAndLength()

std::pair< unsigned, unsigned > llzk::component::StructDefOp::getODSOperandIndexAndLength ( unsigned index)
inline

Definition at line 1371 of file Ops.h.inc.

◆ getODSOperands()

::mlir::Operation::operand_range llzk::component::StructDefOp::getODSOperands ( unsigned index)
inline

Definition at line 1375 of file Ops.h.inc.

◆ getODSResultIndexAndLength()

std::pair< unsigned, unsigned > llzk::component::StructDefOp::getODSResultIndexAndLength ( unsigned index)
inline

Definition at line 1381 of file Ops.h.inc.

◆ getODSResults()

::mlir::Operation::result_range llzk::component::StructDefOp::getODSResults ( unsigned index)
inline

Definition at line 1385 of file Ops.h.inc.

◆ getOperationName()

constexpr ::llvm::StringLiteral llzk::component::StructDefOp::getOperationName ( )
inlinestatic

Definition at line 1367 of file Ops.h.inc.

◆ getProductFuncOp()

FuncDefOp llzk::component::StructDefOp::getProductFuncOp ( )

Gets the FuncDefOp that defines the product function in this structure, if present, or nullptr otherwise.

Definition at line 474 of file Ops.cpp.

◆ getPropertiesAsAttr()

mlir::Attribute llzk::component::StructDefOp::getPropertiesAsAttr ( ::mlir::MLIRContext * ctx,
const Properties & prop )
static

Definition at line 1862 of file Ops.cpp.inc.

◆ getSymName()

llvm::StringRef llzk::component::StructDefOp::getSymName ( )

Definition at line 1910 of file Ops.cpp.inc.

◆ getSymNameAttr()

::mlir::StringAttr llzk::component::StructDefOp::getSymNameAttr ( )
inline

Definition at line 1404 of file Ops.h.inc.

◆ getSymNameAttrName() [1/2]

::mlir::StringAttr llzk::component::StructDefOp::getSymNameAttrName ( )
inline

Definition at line 1359 of file Ops.h.inc.

◆ getSymNameAttrName() [2/2]

::mlir::StringAttr llzk::component::StructDefOp::getSymNameAttrName ( ::mlir::OperationName name)
inlinestatic

Definition at line 1363 of file Ops.h.inc.

◆ getTemplateExprOpNames()

SmallVector< Attribute > llzk::component::StructDefOp::getTemplateExprOpNames ( )

If this struct.def is within a poly.template, return names of all poly.expr within the poly.template in the order they are defined.

Otherwise, return empty. The names are returned as FlatSymbolRefAttr but the more general Attribute type is used in the return type since that's usually what's needed.

Definition at line 210 of file Ops.cpp.

◆ getTemplateParamOpNames()

SmallVector< Attribute > llzk::component::StructDefOp::getTemplateParamOpNames ( )

If this struct.def is within a poly.template, return names of all poly.param within the poly.template in the order they are defined.

Otherwise, return empty. The names are returned as FlatSymbolRefAttr but the more general Attribute type is used in the return type since that's usually what's needed.

Definition at line 202 of file Ops.cpp.

◆ getType() [1/2]

StructType llzk::component::StructDefOp::getType ( ::std::optional<::mlir::ArrayAttr > constParams = {})

Gets the StructType representing this struct.

If the constParams to use in the type are not given, the StructType will use this->getParams().

◆ getType() [2/2]

StructType llzk::component::StructDefOp::getType ( ::std::optional<::mlir::ArrayAttr > constParams = {}) const
inline

Definition at line 1454 of file Ops.h.inc.

◆ hasColumns()

::mlir::LogicalResult llzk::component::StructDefOp::hasColumns ( )
inline

Returns whether the struct defines members marked as columns.

Definition at line 1466 of file Ops.h.inc.

◆ hasComputeConstrain()

bool llzk::component::StructDefOp::hasComputeConstrain ( )
inline

Returns true iff this structure defines compute and constrain functions.

Definition at line 1489 of file Ops.h.inc.

◆ hasSignals()

::mlir::LogicalResult llzk::component::StructDefOp::hasSignals ( )
inline

Returns whether the struct defines members marked as signals.

Definition at line 1473 of file Ops.h.inc.

◆ hasTemplateSymbolBindings()

bool llzk::component::StructDefOp::hasTemplateSymbolBindings ( )

Return true iff the struct.def appears within a poly.template that defines constant parameters and/or expressions.

Definition at line 195 of file Ops.cpp.

◆ isMainComponent()

bool llzk::component::StructDefOp::isMainComponent ( )

Return true iff this struct.def is the main struct. See llzk::MAIN_ATTR_NAME.

Definition at line 478 of file Ops.cpp.

◆ parse()

mlir::ParseResult llzk::component::StructDefOp::parse ( ::mlir::OpAsmParser & parser,
::mlir::OperationState & result )
static

Definition at line 2066 of file Ops.cpp.inc.

◆ populateInherentAttrs()

void llzk::component::StructDefOp::populateInherentAttrs ( ::mlir::MLIRContext * ctx,
const Properties & prop,
::mlir::NamedAttrList & attrs )
static

Definition at line 1897 of file Ops.cpp.inc.

◆ print()

void llzk::component::StructDefOp::print ( ::mlir::OpAsmPrinter & _odsPrinter)

Definition at line 2091 of file Ops.cpp.inc.

◆ readProperties()

LogicalResult llzk::component::StructDefOp::readProperties ( ::mlir::DialectBytecodeReader & reader,
::mlir::OperationState & state )
static

Definition at line 490 of file Ops.cpp.

◆ setInherentAttr()

void llzk::component::StructDefOp::setInherentAttr ( Properties & prop,
llvm::StringRef name,
mlir::Attribute value )
static

Definition at line 1890 of file Ops.cpp.inc.

◆ setPropertiesFromAttr()

llvm::LogicalResult llzk::component::StructDefOp::setPropertiesFromAttr ( Properties & prop,
::mlir::Attribute attr,
::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError )
static

Definition at line 1839 of file Ops.cpp.inc.

◆ setSymName()

void llzk::component::StructDefOp::setSymName ( ::llvm::StringRef attrValue)

Definition at line 1915 of file Ops.cpp.inc.

◆ setSymNameAttr()

void llzk::component::StructDefOp::setSymNameAttr ( ::mlir::StringAttr attr)
inline

Definition at line 1409 of file Ops.h.inc.

◆ verifyInherentAttrs()

llvm::LogicalResult llzk::component::StructDefOp::verifyInherentAttrs ( ::mlir::OperationName opName,
::mlir::NamedAttrList & attrs,
llvm::function_ref<::mlir::InFlightDiagnostic()> emitError )
static

Definition at line 1901 of file Ops.cpp.inc.

◆ verifyInvariants()

llvm::LogicalResult llzk::component::StructDefOp::verifyInvariants ( )

Definition at line 2062 of file Ops.cpp.inc.

◆ verifyInvariantsImpl()

llvm::LogicalResult llzk::component::StructDefOp::verifyInvariantsImpl ( )

Definition at line 2046 of file Ops.cpp.inc.

◆ verifyRegions()

LogicalResult llzk::component::StructDefOp::verifyRegions ( )

Definition at line 320 of file Ops.cpp.

◆ writeProperties()

void llzk::component::StructDefOp::writeProperties ( ::mlir::DialectBytecodeWriter & writer)

Definition at line 515 of file Ops.cpp.


The documentation for this class was generated from the following files: