|
LLZK 0.1.0
Veridise's ZK Language IR
|
A reference to a "source", which is the base value from which other SSA values are derived. More...
#include <SourceRef.h>
Classes | |
| struct | Hash |
Public Member Functions | |
| SourceRef (mlir::BlockArgument b) | |
| SourceRef (mlir::BlockArgument b, std::vector< SourceRefIndex > f) | |
| SourceRef (component::CreateStructOp createOp) | |
| SourceRef (component::CreateStructOp createOp, std::vector< SourceRefIndex > f) | |
| SourceRef (felt::FeltConstantOp c) | |
| SourceRef (mlir::arith::ConstantIndexOp c) | |
| SourceRef (polymorphic::ConstReadOp c) | |
| mlir::Type | getType () const |
| bool | isConstantFelt () const |
| bool | isConstantIndex () const |
| bool | isTemplateConstant () const |
| bool | isConstant () const |
| bool | isConstantInt () const |
| bool | isFeltVal () const |
| bool | isIndexVal () const |
| bool | isIntegerVal () const |
| bool | isTypeVarVal () const |
| bool | isScalar () const |
| bool | isSignal () const |
| bool | isBlockArgument () const |
| mlir::BlockArgument | getBlockArgument () const |
| unsigned | getInputNum () const |
| bool | isCreateStructOp () const |
| component::CreateStructOp | getCreateStructOp () const |
| llvm::DynamicAPInt | getConstantFeltValue () const |
| llvm::DynamicAPInt | getConstantIndexValue () const |
| llvm::DynamicAPInt | getConstantValue () const |
| bool | isValidPrefix (const SourceRef &prefix) const |
| Returns true iff prefix is a valid prefix of this reference. | |
| mlir::FailureOr< std::vector< SourceRefIndex > > | getSuffix (const SourceRef &prefix) const |
| If prefix is a valid prefix of this reference, return the suffix that remains after removing the prefix. | |
| mlir::FailureOr< SourceRef > | translate (const SourceRef &prefix, const SourceRef &other) const |
| Create a new reference with prefix replaced with other iff prefix is a valid prefix for this reference. | |
| mlir::FailureOr< SourceRef > | getParentPrefix () const |
| Create a new reference that is the immediate prefix of this reference if possible. | |
| std::vector< SourceRef > | getAllChildren (mlir::SymbolTableCollection &tables, mlir::ModuleOp mod) const |
| Get all direct children of this SourceRef, assuming this ref is not a scalar. | |
| SourceRef | createChild (SourceRefIndex r) const |
| SourceRef | createChild (SourceRef other) const |
| const std::vector< SourceRefIndex > & | getPieces () const |
| void | print (mlir::raw_ostream &os) const |
| void | dump () const |
| bool | operator== (const SourceRef &rhs) const |
| bool | operator!= (const SourceRef &rhs) const |
| bool | operator< (const SourceRef &rhs) const |
| bool | operator> (const SourceRef &rhs) const |
Static Public Member Functions | |
| static std::vector< SourceRef > | getAllSourceRefs (mlir::SymbolTableCollection &tables, mlir::ModuleOp mod, SourceRef root) |
| Produce all possible SourceRefs that are present starting from the given root. | |
| static std::vector< SourceRef > | getAllSourceRefs (component::StructDefOp structDef, function::FuncDefOp fnOp) |
| Produce all possible SourceRefs that are present from given struct function. | |
| static std::vector< SourceRef > | getAllSourceRefs (component::StructDefOp structDef, component::FieldDefOp fieldDef) |
| Produce all possible SourceRefs from a specific field in a struct. | |
A reference to a "source", which is the base value from which other SSA values are derived.
The object may be a reference to an individual felt, felt.const, or a composite type, like an array or an entire struct.
These references are relative to a particular function call, so they are either (1) constants, or (2) rooted at a block argument (which is either "self" in @constrain functions or another input) and optionally contain indices into that block argument (e.g., a field reference in a struct or a index into an array).
Definition at line 127 of file SourceRef.h.
|
inlineexplicit |
Definition at line 143 of file SourceRef.h.
|
inline |
Definition at line 144 of file SourceRef.h.
|
inlineexplicit |
Definition at line 147 of file SourceRef.h.
|
inline |
Definition at line 149 of file SourceRef.h.
|
inlineexplicit |
Definition at line 152 of file SourceRef.h.
|
inlineexplicit |
Definition at line 153 of file SourceRef.h.
|
inlineexplicit |
Definition at line 155 of file SourceRef.h.
Definition at line 258 of file SourceRef.h.
|
inline |
Definition at line 252 of file SourceRef.h.
|
inline |
Definition at line 266 of file SourceRef.h.
| std::vector< SourceRef > llzk::SourceRef::getAllChildren | ( | mlir::SymbolTableCollection & | tables, |
| mlir::ModuleOp | mod ) const |
Get all direct children of this SourceRef, assuming this ref is not a scalar.
Definition at line 278 of file SourceRef.cpp.
|
static |
Produce all possible SourceRefs from a specific field in a struct.
May produce multiple if the given field is of an aggregate type.
Definition at line 149 of file SourceRef.cpp.
|
static |
Produce all possible SourceRefs that are present from given struct function.
Definition at line 120 of file SourceRef.cpp.
|
static |
Produce all possible SourceRefs that are present starting from the given root.
|
inline |
Definition at line 186 of file SourceRef.h.
|
inline |
Definition at line 200 of file SourceRef.h.
|
inline |
Definition at line 207 of file SourceRef.h.
|
inline |
Definition at line 213 of file SourceRef.h.
|
inline |
Definition at line 195 of file SourceRef.h.
|
inline |
Definition at line 190 of file SourceRef.h.
|
inline |
Create a new reference that is the immediate prefix of this reference if possible.
Definition at line 239 of file SourceRef.h.
|
inline |
Definition at line 263 of file SourceRef.h.
| FailureOr< std::vector< SourceRefIndex > > llzk::SourceRef::getSuffix | ( | const SourceRef & | prefix | ) | const |
If prefix is a valid prefix of this reference, return the suffix that remains after removing the prefix.
I.e., this = prefix + suffix
| prefix |
Definition at line 214 of file SourceRef.cpp.
| Type llzk::SourceRef::getType | ( | ) | const |
Definition at line 168 of file SourceRef.cpp.
|
inline |
Definition at line 183 of file SourceRef.h.
|
inline |
Definition at line 171 of file SourceRef.h.
|
inline |
Definition at line 160 of file SourceRef.h.
|
inline |
Definition at line 163 of file SourceRef.h.
|
inline |
Definition at line 172 of file SourceRef.h.
|
inline |
Definition at line 192 of file SourceRef.h.
|
inline |
Definition at line 174 of file SourceRef.h.
|
inline |
Definition at line 175 of file SourceRef.h.
|
inline |
Definition at line 176 of file SourceRef.h.
|
inline |
Definition at line 178 of file SourceRef.h.
|
inline |
Definition at line 181 of file SourceRef.h.
|
inline |
Definition at line 167 of file SourceRef.h.
|
inline |
Definition at line 177 of file SourceRef.h.
| bool llzk::SourceRef::isValidPrefix | ( | const SourceRef & | prefix | ) | const |
Returns true iff prefix is a valid prefix of this reference.
Definition at line 198 of file SourceRef.cpp.
|
inline |
Definition at line 270 of file SourceRef.h.
| bool llzk::SourceRef::operator< | ( | const SourceRef & | rhs | ) | const |
Definition at line 323 of file SourceRef.cpp.
| bool llzk::SourceRef::operator== | ( | const SourceRef & | rhs | ) | const |
Definition at line 313 of file SourceRef.cpp.
|
inline |
Definition at line 275 of file SourceRef.h.
| void llzk::SourceRef::print | ( | mlir::raw_ostream & | os | ) | const |
Definition at line 289 of file SourceRef.cpp.
| FailureOr< SourceRef > llzk::SourceRef::translate | ( | const SourceRef & | prefix, |
| const SourceRef & | other ) const |
Create a new reference with prefix replaced with other iff prefix is a valid prefix for this reference.
If this reference is a felt.const, the translation will always succeed and return the felt.const unchanged.
| prefix | |
| other |
Definition at line 225 of file SourceRef.cpp.