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 include {
12class IncludeOp;
13} // namespace include
14} // namespace llzk
15#ifdef GET_OP_CLASSES
16#undef GET_OP_CLASSES
17
18namespace llzk {
19namespace include {
20
21//===----------------------------------------------------------------------===//
22// ::llzk::include::IncludeOp declarations
23//===----------------------------------------------------------------------===//
24
25namespace detail {
27public:
28 struct Properties {
29 using pathTy = ::mlir::StringAttr;
31
32 auto getPath() {
33 auto &propStorage = this->path;
34 return ::llvm::cast<::mlir::StringAttr>(propStorage);
35 }
36 void setPath(const ::mlir::StringAttr &propValue) {
37 this->path = propValue;
38 }
39 using sym_nameTy = ::mlir::StringAttr;
41
42 auto getSymName() {
43 auto &propStorage = this->sym_name;
44 return ::llvm::cast<::mlir::StringAttr>(propStorage);
45 }
46 void setSymName(const ::mlir::StringAttr &propValue) {
47 this->sym_name = propValue;
48 }
49 bool operator==(const Properties &rhs) const {
50 return
51 rhs.path == this->path &&
52 rhs.sym_name == this->sym_name &&
53 true;
54 }
55 bool operator!=(const Properties &rhs) const {
56 return !(*this == rhs);
57 }
58 };
59protected:
60 ::mlir::DictionaryAttr odsAttrs;
61 ::std::optional<::mlir::OperationName> odsOpName;
63 ::mlir::RegionRange odsRegions;
64public:
65 IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
66 odsOpName.emplace("include.from", odsAttrs.getContext());
67 }
68
70
71 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
72 return {index, 1};
73 }
74
76 return properties;
77 }
78
79 ::mlir::DictionaryAttr getAttributes() {
80 return odsAttrs;
81 }
82
83 ::mlir::StringAttr getSymNameAttr() {
84 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
85 return attr;
86 }
87
88 ::llvm::StringRef getSymName();
89 ::mlir::StringAttr getPathAttr() {
90 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().path);
91 return attr;
92 }
93
94 ::llvm::StringRef getPath();
95};
96} // namespace detail
97template <typename RangeT>
99 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
101public:
102 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
103
104 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : IncludeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
105
106 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : IncludeOpGenericAdaptor(values, attrs, Properties{}, {}) {}
107
108 IncludeOpGenericAdaptor(RangeT values, const IncludeOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
109
110 template <typename LateInst = IncludeOp, typename = std::enable_if_t<std::is_same_v<LateInst, IncludeOp>>>
111 IncludeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
112
113 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
114 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
115 }
116
117 RangeT getODSOperands(unsigned index) {
118 auto valueRange = getODSOperandIndexAndLength(index);
119 return {std::next(odsOperands.begin(), valueRange.first),
120 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
121 }
122
123 RangeT getOperands() {
124 return odsOperands;
125 }
126
127private:
128 RangeT odsOperands;
129};
130class IncludeOpAdaptor : public IncludeOpGenericAdaptor<::mlir::ValueRange> {
131public:
134
135 ::llvm::LogicalResult verify(::mlir::Location loc);
136};
137class IncludeOp : public ::mlir::Op<IncludeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolOpInterface::Trait> {
138public:
139 using Op::Op;
140 using Op::print;
142 template <typename RangeT>
146 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
147 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("path"), ::llvm::StringRef("sym_name")};
148 return ::llvm::ArrayRef(attrNames);
149 }
150
151 ::mlir::StringAttr getPathAttrName() {
152 return getAttributeNameForIndex(0);
153 }
154
155 static ::mlir::StringAttr getPathAttrName(::mlir::OperationName name) {
156 return getAttributeNameForIndex(name, 0);
157 }
158
159 ::mlir::StringAttr getSymNameAttrName() {
160 return getAttributeNameForIndex(1);
161 }
162
163 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
164 return getAttributeNameForIndex(name, 1);
165 }
166
167 static constexpr ::llvm::StringLiteral getOperationName() {
168 return ::llvm::StringLiteral("include.from");
169 }
170
171 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
172 return {index, 1};
173 }
174
175 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
176 auto valueRange = getODSOperandIndexAndLength(index);
177 return {std::next(getOperation()->operand_begin(), valueRange.first),
178 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
179 }
180
181 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
182 return {index, 1};
183 }
184
185 ::mlir::Operation::result_range getODSResults(unsigned index) {
186 auto valueRange = getODSResultIndexAndLength(index);
187 return {std::next(getOperation()->result_begin(), valueRange.first),
188 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
189 }
190
191 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
192 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
193 static llvm::hash_code computePropertiesHash(const Properties &prop);
194 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
195 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
196 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
197 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
198 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
199 void writeProperties(::mlir::DialectBytecodeWriter &writer);
200 ::mlir::StringAttr getSymNameAttr() {
201 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
202 }
203
204 ::llvm::StringRef getSymName();
205 ::mlir::StringAttr getPathAttr() {
206 return ::llvm::cast<::mlir::StringAttr>(getProperties().path);
207 }
208
209 ::llvm::StringRef getPath();
210 void setSymNameAttr(::mlir::StringAttr attr) {
211 getProperties().sym_name = attr;
212 }
213
214 void setSymName(::llvm::StringRef attrValue);
215 void setPathAttr(::mlir::StringAttr attr) {
216 getProperties().path = attr;
217 }
218
219 void setPath(::llvm::StringRef attrValue);
220 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
221 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
222 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::llvm::StringRef path);
223 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
224 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
225 ::llvm::LogicalResult verifyInvariantsImpl();
226 ::llvm::LogicalResult verifyInvariants();
227 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
228 void print(::mlir::OpAsmPrinter &_odsPrinter);
229private:
230 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
231 return getAttributeNameForIndex((*this)->getName(), index);
232 }
233
234 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
235 assert(index < 2 && "invalid attribute index");
236 assert(name.getStringRef() == getOperationName() && "invalid operation name");
237 assert(name.isRegistered() && "Operation isn't registered, missing a "
238 "dependent dialect loading?");
239 return name.getAttributeNames()[index];
240 }
241
242public:
243 static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path);
244 static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path);
246 ::mlir::FailureOr<mlir::OwningOpRef<mlir::ModuleOp>> openModule();
248 ::mlir::FailureOr<mlir::ModuleOp> inlineAndErase();
249};
250} // namespace include
251} // namespace llzk
252MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::include::IncludeOp)
253
254
255#endif // GET_OP_CLASSES
256
MlirStringRef name
Definition Poly.cpp:48
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:65
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:102
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:106
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:104
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:102
IncludeOpGenericAdaptor(RangeT values, const IncludeOpGenericAdaptorBase &base)
Definition Ops.h.inc:108
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:117
IncludeOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:111
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:113
static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path)
::mlir::StringAttr getPathAttrName()
Definition Ops.h.inc:151
void setPathAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:215
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:203
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:144
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:167
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:263
IncludeOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:143
IncludeOpAdaptor Adaptor
Definition Ops.h.inc:141
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:175
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:171
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:139
FoldAdaptor::Properties Properties
Definition Ops.h.inc:145
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:187
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:145
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:163
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:213
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:197
::llvm::StringRef getPath()
Definition Ops.cpp.inc:208
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:281
::mlir::StringAttr getPathAttr()
Definition Ops.h.inc:205
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:307
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:159
static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path)
Definition Ops.cpp.inc:221
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:277
::mlir::FailureOr< mlir::OwningOpRef< mlir::ModuleOp > > openModule()
Opens the module this include references but doesn't insert it into the parent module.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:116
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:210
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:185
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:181
::mlir::FailureOr< mlir::ModuleOp > inlineAndErase()
Opens the module this include references and replace this include with that module.
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:146
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:200
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:172
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:79
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:154
void setPath(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:217
::mlir::StringAttr getPathAttrName(::mlir::OperationName name)
Definition Ops.h.inc:155
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:166
IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:65
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:71
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:61
void setPath(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:36
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:46