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 include {
14class IncludeOp;
15} // namespace include
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 include {
29
30//===----------------------------------------------------------------------===//
31// ::llzk::include::IncludeOp declarations
32//===----------------------------------------------------------------------===//
33
34namespace detail {
36public:
37 struct Properties {
38 using pathTy = ::mlir::StringAttr;
40
41 auto getPath() {
42 auto &propStorage = this->path;
43 return ::llvm::cast<::mlir::StringAttr>(propStorage);
44 }
45 void setPath(const ::mlir::StringAttr &propValue) {
46 this->path = propValue;
47 }
48 using sym_nameTy = ::mlir::StringAttr;
50
51 auto getSymName() {
52 auto &propStorage = this->sym_name;
53 return ::llvm::cast<::mlir::StringAttr>(propStorage);
54 }
55 void setSymName(const ::mlir::StringAttr &propValue) {
56 this->sym_name = propValue;
57 }
58 bool operator==(const Properties &rhs) const {
59 return
60 rhs.path == this->path &&
61 rhs.sym_name == this->sym_name &&
62 true;
63 }
64 bool operator!=(const Properties &rhs) const {
65 return !(*this == rhs);
66 }
67 };
68protected:
69 ::mlir::DictionaryAttr odsAttrs;
70 ::std::optional<::mlir::OperationName> odsOpName;
72 ::mlir::RegionRange odsRegions;
73public:
74 IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {});
75
77
78 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
80 return properties;
81 }
82
83 ::mlir::DictionaryAttr getAttributes();
84 ::mlir::StringAttr getSymNameAttr();
85 ::llvm::StringRef getSymName();
86 ::mlir::StringAttr getPathAttr();
87 ::llvm::StringRef getPath();
88};
89} // namespace detail
90template <typename RangeT>
92 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
94public:
95 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
96
97 IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : IncludeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
98
99 template <typename LateInst = IncludeOp, typename = std::enable_if_t<std::is_same_v<LateInst, IncludeOp>>>
100 IncludeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
101
102 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
103 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
104 }
105
106 RangeT getODSOperands(unsigned index) {
107 auto valueRange = getODSOperandIndexAndLength(index);
108 return {std::next(odsOperands.begin(), valueRange.first),
109 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
110 }
111
112 RangeT getOperands() {
113 return odsOperands;
114 }
115
116private:
117 RangeT odsOperands;
118};
119class IncludeOpAdaptor : public IncludeOpGenericAdaptor<::mlir::ValueRange> {
120public:
123
124 ::mlir::LogicalResult verify(::mlir::Location loc);
125};
126class 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> {
127public:
128 using Op::Op;
129 using Op::print;
131 template <typename RangeT>
135 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
136 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("path"), ::llvm::StringRef("sym_name")};
137 return ::llvm::ArrayRef(attrNames);
138 }
139
140 ::mlir::StringAttr getPathAttrName() {
141 return getAttributeNameForIndex(0);
142 }
143
144 static ::mlir::StringAttr getPathAttrName(::mlir::OperationName name) {
145 return getAttributeNameForIndex(name, 0);
146 }
147
148 ::mlir::StringAttr getSymNameAttrName() {
149 return getAttributeNameForIndex(1);
150 }
151
152 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
153 return getAttributeNameForIndex(name, 1);
154 }
155
156 static constexpr ::llvm::StringLiteral getOperationName() {
157 return ::llvm::StringLiteral("include.from");
158 }
159
160 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
161 ::mlir::Operation::operand_range getODSOperands(unsigned index);
162 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
163 ::mlir::Operation::result_range getODSResults(unsigned index);
164 static ::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
165 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
166 static llvm::hash_code computePropertiesHash(const Properties &prop);
167 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
168 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
169 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
170 static ::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
171 static ::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
172 void writeProperties(::mlir::DialectBytecodeWriter &writer);
173 ::mlir::StringAttr getSymNameAttr();
174 ::llvm::StringRef getSymName();
175 ::mlir::StringAttr getPathAttr();
176 ::llvm::StringRef getPath();
177 void setSymNameAttr(::mlir::StringAttr attr);
178 void setSymName(::llvm::StringRef attrValue);
179 void setPathAttr(::mlir::StringAttr attr);
180 void setPath(::llvm::StringRef attrValue);
181 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
182 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::StringAttr path);
183 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::llvm::StringRef path);
184 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::llvm::StringRef path);
185 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
186 ::mlir::LogicalResult verifyInvariantsImpl();
187 ::mlir::LogicalResult verifyInvariants();
188 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
189 void print(::mlir::OpAsmPrinter &_odsPrinter);
190private:
191 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
192 return getAttributeNameForIndex((*this)->getName(), index);
193 }
194
195 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
196 assert(index < 2 && "invalid attribute index");
197 assert(name.getStringRef() == getOperationName() && "invalid operation name");
198 assert(name.isRegistered() && "Operation isn't registered, missing a "
199 "dependent dialect loading?");
200 return name.getAttributeNames()[index];
201 }
202
203public:
204 static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path);
205 static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path);
207 ::mlir::FailureOr<mlir::OwningOpRef<mlir::ModuleOp>> openModule();
209 ::mlir::FailureOr<mlir::ModuleOp> inlineAndErase();
210};
211} // namespace include
212} // namespace llzk
213MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::include::IncludeOp)
214
215
216#endif // GET_OP_CLASSES
217
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:95
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:87
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:97
IncludeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:95
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:106
IncludeOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:100
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:102
static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path)
::mlir::StringAttr getPathAttrName()
Definition Ops.h.inc:140
void setPathAttr(::mlir::StringAttr attr)
Definition Ops.cpp.inc:281
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:335
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:259
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:133
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:156
IncludeOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:132
IncludeOpAdaptor Adaptor
Definition Ops.h.inc:130
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:101
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:191
FoldAdaptor::Properties Properties
Definition Ops.h.inc:134
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:197
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:152
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:277
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:121
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:249
::llvm::StringRef getPath()
Definition Ops.cpp.inc:268
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:239
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:339
::mlir::StringAttr getSymNameAttr()
Definition Ops.cpp.inc:255
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:365
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:148
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:289
::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:168
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.cpp.inc:273
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:224
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:111
::mlir::FailureOr< mlir::ModuleOp > inlineAndErase()
Opens the module this include references and replace this include with that module.
::mlir::StringAttr getPathAttr()
Definition Ops.cpp.inc:264
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:135
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:115
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:206
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:105
void setPath(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:285
::mlir::StringAttr getPathAttrName(::mlir::OperationName name)
Definition Ops.h.inc:144
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:218
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:321
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:56
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:70
IncludeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:50
void setPath(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:45
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:55