LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
TransformationPassEnums.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: TransformationPasses.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11namespace polymorphic {
12// Specifies the extent to which unused parameterized structs are removed during the flattening pass.
13enum class StructCleanupMode : uint32_t {
18};
19
20::std::optional<StructCleanupMode> symbolizeStructCleanupMode(uint32_t);
22::std::optional<StructCleanupMode> symbolizeStructCleanupMode(::llvm::StringRef);
23inline constexpr unsigned getMaxEnumValForStructCleanupMode() {
24 return 3;
25}
26
27
28inline ::llvm::StringRef stringifyEnum(StructCleanupMode enumValue) {
29 return stringifyStructCleanupMode(enumValue);
30}
31
32template <typename EnumType>
33::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);
34
35template <>
36inline ::std::optional<StructCleanupMode> symbolizeEnum<StructCleanupMode>(::llvm::StringRef str) {
38}
39} // namespace polymorphic
40} // namespace llzk
41
42namespace mlir {
43template <typename T, typename>
44struct FieldParser;
45
46template<>
48 template <typename ParserT>
49 static FailureOr<::llzk::polymorphic::StructCleanupMode> parse(ParserT &parser) {
50 // Parse the keyword/string containing the enum.
51 std::string enumKeyword;
52 auto loc = parser.getCurrentLocation();
53 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
54 return parser.emitError(loc, "expected keyword for Specifies the extent to which unused parameterized structs are removed during the flattening pass.");
55
56 // Symbolize the keyword.
57 if (::std::optional<::llzk::polymorphic::StructCleanupMode> attr = ::llzk::polymorphic::symbolizeEnum<::llzk::polymorphic::StructCleanupMode>(enumKeyword))
58 return *attr;
59 return parser.emitError(loc, "invalid Specifies the extent to which unused parameterized structs are removed during the flattening pass. specification: ") << enumKeyword;
60 }
61};
62} // namespace mlir
63
64namespace llvm {
65inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::llzk::polymorphic::StructCleanupMode value) {
66 auto valueStr = stringifyEnum(value);
67 switch (value) {
68 case ::llzk::polymorphic::StructCleanupMode::Disabled:
69 case ::llzk::polymorphic::StructCleanupMode::Preimage:
70 break;
71 default:
72 return p << '"' << valueStr << '"';
73 }
74 return p << valueStr;
75}
76} // namespace llvm
77
78namespace llvm {
79template<> struct DenseMapInfo<::llzk::polymorphic::StructCleanupMode> {
80 using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;
81
82 static inline ::llzk::polymorphic::StructCleanupMode getEmptyKey() {
83 return static_cast<::llzk::polymorphic::StructCleanupMode>(StorageInfo::getEmptyKey());
84 }
85
86 static inline ::llzk::polymorphic::StructCleanupMode getTombstoneKey() {
87 return static_cast<::llzk::polymorphic::StructCleanupMode>(StorageInfo::getTombstoneKey());
88 }
89
90 static unsigned getHashValue(const ::llzk::polymorphic::StructCleanupMode &val) {
91 return StorageInfo::getHashValue(static_cast<uint32_t>(val));
92 }
93
94 static bool isEqual(const ::llzk::polymorphic::StructCleanupMode &lhs, const ::llzk::polymorphic::StructCleanupMode &rhs) {
95 return lhs == rhs;
96 }
97};
98}
99
inline ::llvm::raw_ostream & operator<<(::llvm::raw_ostream &p, ::llzk::OutputStream value)
::std::optional< StructCleanupMode > symbolizeStructCleanupMode(::llvm::StringRef str)
::std::optional< EnumType > symbolizeEnum(::llvm::StringRef)
inline ::llvm::StringRef stringifyEnum(StructCleanupMode enumValue)
inline ::std::optional< StructCleanupMode > symbolizeEnum< StructCleanupMode >(::llvm::StringRef str)
::llvm::StringRef stringifyStructCleanupMode(StructCleanupMode val)
constexpr unsigned getMaxEnumValForStructCleanupMode()
static unsigned getHashValue(const ::llzk::polymorphic::StructCleanupMode &val)
static inline ::llzk::polymorphic::StructCleanupMode getEmptyKey()
static inline ::llzk::polymorphic::StructCleanupMode getTombstoneKey()
static bool isEqual(const ::llzk::polymorphic::StructCleanupMode &lhs, const ::llzk::polymorphic::StructCleanupMode &rhs)