LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
SMTEnums.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Enum Utility Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: SMT.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11namespace smt {
12// smt bit-vector comparison predicate
13enum class BVCmpPredicate : uint64_t {
14 slt = 0,
15 sle = 1,
16 sgt = 2,
17 sge = 3,
18 ult = 4,
19 ule = 5,
20 ugt = 6,
21 uge = 7,
22};
23
24::std::optional<BVCmpPredicate> symbolizeBVCmpPredicate(uint64_t);
26::std::optional<BVCmpPredicate> symbolizeBVCmpPredicate(::llvm::StringRef);
27inline constexpr unsigned getMaxEnumValForBVCmpPredicate() {
28 return 7;
29}
30
31
32inline ::llvm::StringRef stringifyEnum(BVCmpPredicate enumValue) {
33 return stringifyBVCmpPredicate(enumValue);
34}
35
36template <typename EnumType>
37::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);
38
39template <>
40inline ::std::optional<BVCmpPredicate> symbolizeEnum<BVCmpPredicate>(::llvm::StringRef str) {
41 return symbolizeBVCmpPredicate(str);
42}
43
44class BVCmpPredicateAttr : public ::mlir::IntegerAttr {
45public:
47 using ::mlir::IntegerAttr::IntegerAttr;
48 static bool classof(::mlir::Attribute attr);
49 static BVCmpPredicateAttr get(::mlir::MLIRContext *context, BVCmpPredicate val);
51};
52} // namespace smt
53} // namespace llzk
54
55namespace mlir {
56template <typename T, typename>
57struct FieldParser;
58
59template<>
61 template <typename ParserT>
62 static FailureOr<::llzk::smt::BVCmpPredicate> parse(ParserT &parser) {
63 // Parse the keyword/string containing the enum.
64 std::string enumKeyword;
65 auto loc = parser.getCurrentLocation();
66 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
67 return parser.emitError(loc, "expected keyword for smt bit-vector comparison predicate");
68
69 // Symbolize the keyword.
70 if (::std::optional<::llzk::smt::BVCmpPredicate> attr = ::llzk::smt::symbolizeEnum<::llzk::smt::BVCmpPredicate>(enumKeyword))
71 return *attr;
72 return parser.emitError(loc, "invalid smt bit-vector comparison predicate specification: ") << enumKeyword;
73 }
74};
75
80template<>
81struct FieldParser<std::optional<::llzk::smt::BVCmpPredicate>, std::optional<::llzk::smt::BVCmpPredicate>> {
82 template <typename ParserT>
83 static FailureOr<std::optional<::llzk::smt::BVCmpPredicate>> parse(ParserT &parser) {
84 // Parse the keyword/string containing the enum.
85 std::string enumKeyword;
86 auto loc = parser.getCurrentLocation();
87 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
88 return std::optional<::llzk::smt::BVCmpPredicate>{};
89
90 // Symbolize the keyword.
91 if (::std::optional<::llzk::smt::BVCmpPredicate> attr = ::llzk::smt::symbolizeEnum<::llzk::smt::BVCmpPredicate>(enumKeyword))
92 return attr;
93 return parser.emitError(loc, "invalid smt bit-vector comparison predicate specification: ") << enumKeyword;
94 }
95};
96} // namespace mlir
97
98namespace llvm {
99inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::llzk::smt::BVCmpPredicate value) {
100 auto valueStr = stringifyEnum(value);
101 return p << valueStr;
102}
103} // namespace llvm
104
105namespace llvm {
106template<> struct DenseMapInfo<::llzk::smt::BVCmpPredicate> {
107 using StorageInfo = ::llvm::DenseMapInfo<uint64_t>;
108
109 static inline ::llzk::smt::BVCmpPredicate getEmptyKey() {
110 return static_cast<::llzk::smt::BVCmpPredicate>(StorageInfo::getEmptyKey());
111 }
112
113 static inline ::llzk::smt::BVCmpPredicate getTombstoneKey() {
114 return static_cast<::llzk::smt::BVCmpPredicate>(StorageInfo::getTombstoneKey());
115 }
116
117 static unsigned getHashValue(const ::llzk::smt::BVCmpPredicate &val) {
118 return StorageInfo::getHashValue(static_cast<uint64_t>(val));
119 }
120
121 static bool isEqual(const ::llzk::smt::BVCmpPredicate &lhs, const ::llzk::smt::BVCmpPredicate &rhs) {
122 return lhs == rhs;
123 }
124};
125}
126
127namespace llzk {
128namespace smt {
129// smt comparison predicate for integers
130enum class IntPredicate : uint64_t {
131 lt = 0,
132 le = 1,
133 gt = 2,
134 ge = 3,
135};
136
137::std::optional<IntPredicate> symbolizeIntPredicate(uint64_t);
138::llvm::StringRef stringifyIntPredicate(IntPredicate);
139::std::optional<IntPredicate> symbolizeIntPredicate(::llvm::StringRef);
140inline constexpr unsigned getMaxEnumValForIntPredicate() {
141 return 3;
142}
143
144
145inline ::llvm::StringRef stringifyEnum(IntPredicate enumValue) {
146 return stringifyIntPredicate(enumValue);
147}
148
149template <typename EnumType>
150::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);
151
152template <>
153inline ::std::optional<IntPredicate> symbolizeEnum<IntPredicate>(::llvm::StringRef str) {
154 return symbolizeIntPredicate(str);
155}
156
157class IntPredicateAttr : public ::mlir::IntegerAttr {
158public:
160 using ::mlir::IntegerAttr::IntegerAttr;
161 static bool classof(::mlir::Attribute attr);
162 static IntPredicateAttr get(::mlir::MLIRContext *context, IntPredicate val);
163 IntPredicate getValue() const;
164};
165} // namespace smt
166} // namespace llzk
167
168namespace mlir {
169template <typename T, typename>
170struct FieldParser;
171
172template<>
174 template <typename ParserT>
175 static FailureOr<::llzk::smt::IntPredicate> parse(ParserT &parser) {
176 // Parse the keyword/string containing the enum.
177 std::string enumKeyword;
178 auto loc = parser.getCurrentLocation();
179 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
180 return parser.emitError(loc, "expected keyword for smt comparison predicate for integers");
181
182 // Symbolize the keyword.
183 if (::std::optional<::llzk::smt::IntPredicate> attr = ::llzk::smt::symbolizeEnum<::llzk::smt::IntPredicate>(enumKeyword))
184 return *attr;
185 return parser.emitError(loc, "invalid smt comparison predicate for integers specification: ") << enumKeyword;
186 }
187};
188
193template<>
194struct FieldParser<std::optional<::llzk::smt::IntPredicate>, std::optional<::llzk::smt::IntPredicate>> {
195 template <typename ParserT>
196 static FailureOr<std::optional<::llzk::smt::IntPredicate>> parse(ParserT &parser) {
197 // Parse the keyword/string containing the enum.
198 std::string enumKeyword;
199 auto loc = parser.getCurrentLocation();
200 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
201 return std::optional<::llzk::smt::IntPredicate>{};
202
203 // Symbolize the keyword.
204 if (::std::optional<::llzk::smt::IntPredicate> attr = ::llzk::smt::symbolizeEnum<::llzk::smt::IntPredicate>(enumKeyword))
205 return attr;
206 return parser.emitError(loc, "invalid smt comparison predicate for integers specification: ") << enumKeyword;
207 }
208};
209} // namespace mlir
210
211namespace llvm {
212inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::llzk::smt::IntPredicate value) {
213 auto valueStr = stringifyEnum(value);
214 return p << valueStr;
215}
216} // namespace llvm
217
218namespace llvm {
219template<> struct DenseMapInfo<::llzk::smt::IntPredicate> {
220 using StorageInfo = ::llvm::DenseMapInfo<uint64_t>;
221
222 static inline ::llzk::smt::IntPredicate getEmptyKey() {
223 return static_cast<::llzk::smt::IntPredicate>(StorageInfo::getEmptyKey());
224 }
225
226 static inline ::llzk::smt::IntPredicate getTombstoneKey() {
227 return static_cast<::llzk::smt::IntPredicate>(StorageInfo::getTombstoneKey());
228 }
229
230 static unsigned getHashValue(const ::llzk::smt::IntPredicate &val) {
231 return StorageInfo::getHashValue(static_cast<uint64_t>(val));
232 }
233
234 static bool isEqual(const ::llzk::smt::IntPredicate &lhs, const ::llzk::smt::IntPredicate &rhs) {
235 return lhs == rhs;
236 }
237};
238}
239
BVCmpPredicate getValue() const
static BVCmpPredicateAttr get(::mlir::MLIRContext *context, BVCmpPredicate val)
static bool classof(::mlir::Attribute attr)
static bool classof(::mlir::Attribute attr)
static IntPredicateAttr get(::mlir::MLIRContext *context, IntPredicate val)
IntPredicate getValue() const
raw_ostream & operator<<(raw_ostream &os, llvm::PointerUnion< mlir::Value, mlir::Operation * > ptr)
::std::optional< EnumType > symbolizeEnum(::llvm::StringRef)
inline ::llvm::StringRef stringifyEnum(BVCmpPredicate enumValue)
::llvm::StringRef stringifyBVCmpPredicate(BVCmpPredicate val)
inline ::std::optional< IntPredicate > symbolizeEnum< IntPredicate >(::llvm::StringRef str)
constexpr unsigned getMaxEnumValForBVCmpPredicate()
::llvm::StringRef stringifyIntPredicate(IntPredicate val)
::std::optional< IntPredicate > symbolizeIntPredicate(::llvm::StringRef str)
::std::optional< BVCmpPredicate > symbolizeBVCmpPredicate(::llvm::StringRef str)
constexpr unsigned getMaxEnumValForIntPredicate()
inline ::std::optional< BVCmpPredicate > symbolizeEnum< BVCmpPredicate >(::llvm::StringRef str)
static bool isEqual(const ::llzk::smt::BVCmpPredicate &lhs, const ::llzk::smt::BVCmpPredicate &rhs)
static unsigned getHashValue(const ::llzk::smt::BVCmpPredicate &val)
static inline ::llzk::smt::BVCmpPredicate getEmptyKey()
static inline ::llzk::smt::BVCmpPredicate getTombstoneKey()
::llvm::DenseMapInfo< uint64_t > StorageInfo
static unsigned getHashValue(const ::llzk::smt::IntPredicate &val)
static inline ::llzk::smt::IntPredicate getEmptyKey()
static inline ::llzk::smt::IntPredicate getTombstoneKey()
static bool isEqual(const ::llzk::smt::IntPredicate &lhs, const ::llzk::smt::IntPredicate &rhs)
::llvm::DenseMapInfo< uint64_t > StorageInfo
static FailureOr< std::optional<::llzk::smt::BVCmpPredicate > > parse(ParserT &parser)
static FailureOr< std::optional<::llzk::smt::IntPredicate > > parse(ParserT &parser)
static FailureOr<::llzk::smt::BVCmpPredicate > parse(ParserT &parser)
static FailureOr<::llzk::smt::IntPredicate > parse(ParserT &parser)