LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#if defined(GET_OP_CLASSES) || defined(GET_OP_FWD_DEFINES)
11#undef GET_OP_FWD_DEFINES
12namespace llzk {
13namespace string {
14class LitStringOp;
15} // namespace string
16} // namespace llzk
17#endif
18
19#ifdef GET_OP_CLASSES
20#undef GET_OP_CLASSES
21
22
23//===----------------------------------------------------------------------===//
24// Local Utility Method Definitions
25//===----------------------------------------------------------------------===//
26
27namespace llzk {
28namespace string {
29
30//===----------------------------------------------------------------------===//
31// ::llzk::string::LitStringOp declarations
32//===----------------------------------------------------------------------===//
33
34namespace detail {
36public:
37 struct Properties {
38 using valueTy = ::mlir::StringAttr;
40
41 auto getValue() {
42 auto &propStorage = this->value;
43 return ::llvm::cast<::mlir::StringAttr>(propStorage);
44 }
45 void setValue(const ::mlir::StringAttr &propValue) {
46 this->value = propValue;
47 }
48 bool operator==(const Properties &rhs) const {
49 return
50 rhs.value == this->value &&
51 true;
52 }
53 bool operator!=(const Properties &rhs) const {
54 return !(*this == rhs);
55 }
56 };
57protected:
58 ::mlir::DictionaryAttr odsAttrs;
59 ::std::optional<::mlir::OperationName> odsOpName;
61 ::mlir::RegionRange odsRegions;
62public:
63 LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {});
64
66
67 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
69 return properties;
70 }
71
72 ::mlir::DictionaryAttr getAttributes();
73 ::mlir::StringAttr getValueAttr();
74 ::llvm::StringRef getValue();
75};
76} // namespace detail
77template <typename RangeT>
79 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
81public:
82 LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
83
84 LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : LitStringOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
85
86 template <typename LateInst = LitStringOp, typename = std::enable_if_t<std::is_same_v<LateInst, LitStringOp>>>
87 LitStringOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
88
89 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
90 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
91 }
92
93 RangeT getODSOperands(unsigned index) {
94 auto valueRange = getODSOperandIndexAndLength(index);
95 return {std::next(odsOperands.begin(), valueRange.first),
96 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
97 }
98
99 RangeT getOperands() {
100 return odsOperands;
101 }
102
103private:
104 RangeT odsOperands;
105};
106class LitStringOpAdaptor : public LitStringOpGenericAdaptor<::mlir::ValueRange> {
107public:
110
111 ::mlir::LogicalResult verify(::mlir::Location loc);
112};
113class LitStringOp : public ::mlir::Op<LitStringOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::string::StringType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::ConstantLike> {
114public:
115 using Op::Op;
116 using Op::print;
118 template <typename RangeT>
122 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
123 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("value")};
124 return ::llvm::ArrayRef(attrNames);
125 }
126
127 ::mlir::StringAttr getValueAttrName() {
128 return getAttributeNameForIndex(0);
129 }
130
131 static ::mlir::StringAttr getValueAttrName(::mlir::OperationName name) {
132 return getAttributeNameForIndex(name, 0);
133 }
134
135 static constexpr ::llvm::StringLiteral getOperationName() {
136 return ::llvm::StringLiteral("string.new");
137 }
138
139 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
140 ::mlir::Operation::operand_range getODSOperands(unsigned index);
141 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
142 ::mlir::Operation::result_range getODSResults(unsigned index);
143 ::mlir::TypedValue<::llzk::string::StringType> getResult();
144 static ::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
145 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
146 static llvm::hash_code computePropertiesHash(const Properties &prop);
147 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
148 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
149 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
150 static ::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
151 static ::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
152 void writeProperties(::mlir::DialectBytecodeWriter &writer);
153 ::mlir::StringAttr getValueAttr();
154 ::llvm::StringRef getValue();
155 void setValueAttr(::mlir::StringAttr attr);
156 void setValue(::llvm::StringRef attrValue);
157 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value);
158 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr value);
159 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llvm::StringRef value);
160 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef value);
161 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
162 ::mlir::LogicalResult verifyInvariantsImpl();
163 ::mlir::LogicalResult verifyInvariants();
164 ::mlir::OpFoldResult fold(FoldAdaptor adaptor);
165 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
166 void print(::mlir::OpAsmPrinter &_odsPrinter);
167 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
168private:
169 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
170 return getAttributeNameForIndex((*this)->getName(), index);
171 }
172
173 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
174 assert(index < 1 && "invalid attribute index");
175 assert(name.getStringRef() == getOperationName() && "invalid operation name");
176 assert(name.isRegistered() && "Operation isn't registered, missing a "
177 "dependent dialect loading?");
178 return name.getAttributeNames()[index];
179 }
180
181public:
182};
183} // namespace string
184} // namespace llzk
185MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::string::LitStringOp)
186
187
188#endif // GET_OP_CLASSES
189
LitStringOpAdaptor(LitStringOp op)
Definition Ops.cpp.inc:85
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:87
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:82
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:93
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:82
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:89
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:84
LitStringOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:87
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:272
LitStringOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:119
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:164
void setValueAttr(::mlir::StringAttr attr)
Definition Ops.cpp.inc:216
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value)
Definition Ops.cpp.inc:224
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:297
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:120
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:202
::mlir::TypedValue<::llzk::string::StringType > getResult()
Definition Ops.cpp.inc:116
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:254
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:120
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:182
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:96
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
Definition Ops.cpp:26
::mlir::StringAttr getValueAttr()
Definition Ops.cpp.inc:207
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:276
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:169
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:122
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:305
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:106
LitStringOpAdaptor Adaptor
Definition Ops.h.inc:117
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:135
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:186
void setValue(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:220
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:195
::mlir::StringAttr getValueAttrName(::mlir::OperationName name)
Definition Ops.h.inc:131
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:100
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:148
::mlir::StringAttr getValueAttrName()
Definition Ops.h.inc:127
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:175
FoldAdaptor::Properties Properties
Definition Ops.h.inc:121
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:110
::llvm::StringRef getValue()
Definition Ops.cpp.inc:211
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:66
LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:60
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:59
void setValue(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:45