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
10namespace llzk {
11namespace string {
12class LitStringOp;
13} // namespace string
14} // namespace llzk
15#ifdef GET_OP_CLASSES
16#undef GET_OP_CLASSES
17
18namespace llzk {
19namespace string {
20
21//===----------------------------------------------------------------------===//
22// ::llzk::string::LitStringOp declarations
23//===----------------------------------------------------------------------===//
24
25namespace detail {
27public:
28 struct Properties {
29 using valueTy = ::mlir::StringAttr;
31
32 auto getValue() {
33 auto &propStorage = this->value;
34 return ::llvm::cast<::mlir::StringAttr>(propStorage);
35 }
36 void setValue(const ::mlir::StringAttr &propValue) {
37 this->value = propValue;
38 }
39 bool operator==(const Properties &rhs) const {
40 return
41 rhs.value == this->value &&
42 true;
43 }
44 bool operator!=(const Properties &rhs) const {
45 return !(*this == rhs);
46 }
47 };
48protected:
49 ::mlir::DictionaryAttr odsAttrs;
50 ::std::optional<::mlir::OperationName> odsOpName;
52 ::mlir::RegionRange odsRegions;
53public:
54 LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
55 odsOpName.emplace("string.new", odsAttrs.getContext());
56 }
57
59
60 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
61 return {index, 1};
62 }
63
65 return properties;
66 }
67
68 ::mlir::DictionaryAttr getAttributes() {
69 return odsAttrs;
70 }
71
72 ::mlir::StringAttr getValueAttr() {
73 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().value);
74 return attr;
75 }
76
77 ::llvm::StringRef getValue();
78};
79} // namespace detail
80template <typename RangeT>
82 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
84public:
85 LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
86
87 LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : LitStringOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
88
89 LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : LitStringOpGenericAdaptor(values, attrs, Properties{}, {}) {}
90
91 LitStringOpGenericAdaptor(RangeT values, const LitStringOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
92
93 template <typename LateInst = LitStringOp, typename = std::enable_if_t<std::is_same_v<LateInst, LitStringOp>>>
94 LitStringOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
95
96 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
97 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
98 }
99
100 RangeT getODSOperands(unsigned index) {
101 auto valueRange = getODSOperandIndexAndLength(index);
102 return {std::next(odsOperands.begin(), valueRange.first),
103 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
104 }
105
106 RangeT getOperands() {
107 return odsOperands;
108 }
109
110private:
111 RangeT odsOperands;
112};
113class LitStringOpAdaptor : public LitStringOpGenericAdaptor<::mlir::ValueRange> {
114public:
117
118 ::llvm::LogicalResult verify(::mlir::Location loc);
119};
120class 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> {
121public:
122 using Op::Op;
123 using Op::print;
125 template <typename RangeT>
129 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
130 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("value")};
131 return ::llvm::ArrayRef(attrNames);
132 }
133
134 ::mlir::StringAttr getValueAttrName() {
135 return getAttributeNameForIndex(0);
136 }
137
138 static ::mlir::StringAttr getValueAttrName(::mlir::OperationName name) {
139 return getAttributeNameForIndex(name, 0);
140 }
141
142 static constexpr ::llvm::StringLiteral getOperationName() {
143 return ::llvm::StringLiteral("string.new");
144 }
145
146 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
147 return {index, 1};
148 }
149
150 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
151 auto valueRange = getODSOperandIndexAndLength(index);
152 return {std::next(getOperation()->operand_begin(), valueRange.first),
153 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
154 }
155
156 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
157 return {index, 1};
158 }
159
160 ::mlir::Operation::result_range getODSResults(unsigned index) {
161 auto valueRange = getODSResultIndexAndLength(index);
162 return {std::next(getOperation()->result_begin(), valueRange.first),
163 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
164 }
165
166 ::mlir::TypedValue<::llzk::string::StringType> getResult() {
167 return ::llvm::cast<::mlir::TypedValue<::llzk::string::StringType>>(*getODSResults(0).begin());
168 }
169
170 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
171 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
172 static llvm::hash_code computePropertiesHash(const Properties &prop);
173 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
174 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
175 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
176 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
177 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
178 void writeProperties(::mlir::DialectBytecodeWriter &writer);
179 ::mlir::StringAttr getValueAttr() {
180 return ::llvm::cast<::mlir::StringAttr>(getProperties().value);
181 }
182
183 ::llvm::StringRef getValue();
184 void setValueAttr(::mlir::StringAttr attr) {
185 getProperties().value = attr;
186 }
187
188 void setValue(::llvm::StringRef attrValue);
189 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value);
190 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr value);
191 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::llvm::StringRef value);
192 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef value);
193 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
194 ::llvm::LogicalResult verifyInvariantsImpl();
195 ::llvm::LogicalResult verifyInvariants();
196 ::mlir::OpFoldResult fold(FoldAdaptor adaptor);
197 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
198 void print(::mlir::OpAsmPrinter &_odsPrinter);
199 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
200private:
201 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
202 return getAttributeNameForIndex((*this)->getName(), index);
203 }
204
205 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
206 assert(index < 1 && "invalid attribute index");
207 assert(name.getStringRef() == getOperationName() && "invalid operation name");
208 assert(name.isRegistered() && "Operation isn't registered, missing a "
209 "dependent dialect loading?");
210 return name.getAttributeNames()[index];
211 }
212
213public:
214};
215} // namespace string
216} // namespace llzk
217MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::string::LitStringOp)
218
219
220#endif // GET_OP_CLASSES
221
MlirStringRef name
Definition Poly.cpp:48
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:85
LitStringOpAdaptor(LitStringOp op)
Definition Ops.cpp.inc:68
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:70
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:85
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:100
LitStringOpGenericAdaptor(RangeT values, const LitStringOpGenericAdaptorBase &base)
Definition Ops.h.inc:91
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:89
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:96
LitStringOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:87
LitStringOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:94
LitStringOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:126
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:118
void setValueAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:184
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::StringAttr value)
Definition Ops.cpp.inc:170
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:253
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:127
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:156
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:210
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:136
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:146
::mlir::OpFoldResult fold(FoldAdaptor adaptor)
Definition Ops.cpp:26
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:232
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:123
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:129
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:261
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:156
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:160
LitStringOpAdaptor Adaptor
Definition Ops.h.inc:124
::mlir::StringAttr getValueAttr()
Definition Ops.h.inc:179
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:142
void setValue(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:166
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:149
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:228
::mlir::TypedValue<::llzk::string::StringType > getResult()
Definition Ops.h.inc:166
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:140
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:150
::mlir::StringAttr getValueAttrName(::mlir::OperationName name)
Definition Ops.h.inc:138
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:102
::mlir::StringAttr getValueAttrName()
Definition Ops.h.inc:134
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:129
FoldAdaptor::Properties Properties
Definition Ops.h.inc:128
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:79
::llvm::StringRef getValue()
Definition Ops.cpp.inc:161
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:60
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:50
LitStringOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:54
void setValue(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:36