LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
14#endif // GET_OP_LIST
15
16#ifdef GET_OP_CLASSES
17#undef GET_OP_CLASSES
18
19
20//===----------------------------------------------------------------------===//
21// Local Utility Method Definitions
22//===----------------------------------------------------------------------===//
23
24namespace llzk {
25namespace undef {
26
27static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
28 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
29 unsigned valueIndex) {
30 if (!((::llzk::isValidType(type)))) {
31 return op->emitOpError(valueKind) << " #" << valueIndex
32 << " must be a valid LLZK type, but got " << type;
33 }
34 return ::mlir::success();
35}
36} // namespace undef
37} // namespace llzk
38namespace llzk {
39namespace undef {
40
41//===----------------------------------------------------------------------===//
42// ::llzk::undef::UndefOp definitions
43//===----------------------------------------------------------------------===//
44
45namespace detail {
46} // namespace detail
48
49::llvm::LogicalResult UndefOpAdaptor::verify(::mlir::Location loc) {
50 return ::mlir::success();
51}
52
53void UndefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
54 odsState.addTypes(res);
55}
56
57void UndefOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
58 assert(resultTypes.size() == 1u && "mismatched number of results");
59 odsState.addTypes(resultTypes);
60}
61
62void UndefOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
63 assert(operands.size() == 0u && "mismatched number of parameters");
64 odsState.addOperands(operands);
65 odsState.addAttributes(attributes);
66 assert(resultTypes.size() == 1u && "mismatched number of return types");
67 odsState.addTypes(resultTypes);
68}
69
70::llvm::LogicalResult UndefOp::verifyInvariantsImpl() {
71 {
72 unsigned index = 0; (void)index;
73 auto valueGroup0 = getODSResults(0);
74
75 for (auto v : valueGroup0) {
76 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "result", index++)))
77 return ::mlir::failure();
78 }
79 }
80 return ::mlir::success();
81}
82
83::llvm::LogicalResult UndefOp::verifyInvariants() {
84 return verifyInvariantsImpl();
85}
86
87::mlir::ParseResult UndefOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
88 ::mlir::Type resRawType{};
89 ::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
90 if (parser.parseColon())
91 return ::mlir::failure();
92
93 {
94 ::mlir::Type type;
95 if (parser.parseCustomTypeWithFallback(type))
96 return ::mlir::failure();
97 resRawType = type;
98 }
99 {
100 auto loc = parser.getCurrentLocation();(void)loc;
101 if (parser.parseOptionalAttrDict(result.attributes))
102 return ::mlir::failure();
103 }
104 result.addTypes(resTypes);
105 return ::mlir::success();
106}
107
108void UndefOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
109 _odsPrinter << ' ' << ":";
110 _odsPrinter << ' ';
111 {
112 auto type = getRes().getType();
113 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
114 _odsPrinter.printStrippedAttrOrType(validType);
115 else
116 _odsPrinter << type;
117 }
118 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
119 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
120}
121
122void UndefOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
123}
124
125} // namespace undef
126} // namespace llzk
127MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::undef::UndefOp)
128
129
130#endif // GET_OP_CLASSES
131
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:49
UndefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:54
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:108
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:70
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:83
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:122
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res)
Definition Ops.cpp.inc:53
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:117
::mlir::TypedValue<::mlir::Type > getRes()
Definition Ops.h.inc:123
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:87
bool isValidType(Type type)