LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
AnalysisPassEnums.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: AnalysisPasses.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11// Specifies the stream to which the pass prints.
12enum class OutputStream : uint32_t {
13 Outs = 1,
14 Errs = 2,
15 Dbgs = 3,
16};
17
18::std::optional<OutputStream> symbolizeOutputStream(uint32_t);
19::llvm::StringRef stringifyOutputStream(OutputStream);
20::std::optional<OutputStream> symbolizeOutputStream(::llvm::StringRef);
21inline constexpr unsigned getMaxEnumValForOutputStream() {
22 return 3;
23}
24
25
26inline ::llvm::StringRef stringifyEnum(OutputStream enumValue) {
27 return stringifyOutputStream(enumValue);
28}
29
30template <typename EnumType>
31::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);
32
33template <>
34inline ::std::optional<OutputStream> symbolizeEnum<OutputStream>(::llvm::StringRef str) {
35 return symbolizeOutputStream(str);
36}
37} // namespace llzk
38
39namespace mlir {
40template <typename T, typename>
42
43template<>
45 template <typename ParserT>
46 static FailureOr<::llzk::OutputStream> parse(ParserT &parser) {
47 // Parse the keyword/string containing the enum.
48 std::string enumKeyword;
49 auto loc = parser.getCurrentLocation();
50 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
51 return parser.emitError(loc, "expected keyword for Specifies the stream to which the pass prints.");
52
53 // Symbolize the keyword.
54 if (::std::optional<::llzk::OutputStream> attr = ::llzk::symbolizeEnum<::llzk::OutputStream>(enumKeyword))
55 return *attr;
56 return parser.emitError(loc, "invalid Specifies the stream to which the pass prints. specification: ") << enumKeyword;
57 }
58};
59
64template<>
65struct FieldParser<std::optional<::llzk::OutputStream>, std::optional<::llzk::OutputStream>> {
66 template <typename ParserT>
67 static FailureOr<std::optional<::llzk::OutputStream>> parse(ParserT &parser) {
68 // Parse the keyword/string containing the enum.
69 std::string enumKeyword;
70 auto loc = parser.getCurrentLocation();
71 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
72 return std::optional<::llzk::OutputStream>{};
73
74 // Symbolize the keyword.
75 if (::std::optional<::llzk::OutputStream> attr = ::llzk::symbolizeEnum<::llzk::OutputStream>(enumKeyword))
76 return attr;
77 return parser.emitError(loc, "invalid Specifies the stream to which the pass prints. specification: ") << enumKeyword;
78 }
79};
80} // namespace mlir
81
82namespace llvm {
83inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::llzk::OutputStream value) {
84 auto valueStr = stringifyEnum(value);
85 return p << valueStr;
86}
87} // namespace llvm
88
89namespace llvm {
90template<> struct DenseMapInfo<::llzk::OutputStream> {
91 using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;
92
93 static inline ::llzk::OutputStream getEmptyKey() {
94 return static_cast<::llzk::OutputStream>(StorageInfo::getEmptyKey());
95 }
96
97 static inline ::llzk::OutputStream getTombstoneKey() {
98 return static_cast<::llzk::OutputStream>(StorageInfo::getTombstoneKey());
99 }
100
101 static unsigned getHashValue(const ::llzk::OutputStream &val) {
102 return StorageInfo::getHashValue(static_cast<uint32_t>(val));
103 }
104
105 static bool isEqual(const ::llzk::OutputStream &lhs, const ::llzk::OutputStream &rhs) {
106 return lhs == rhs;
107 }
108};
109}
110
raw_ostream & operator<<(raw_ostream &os, llvm::PointerUnion< mlir::Value, mlir::Operation * > ptr)
inline ::llvm::StringRef stringifyEnum(OutputStream enumValue)
constexpr unsigned getMaxEnumValForOutputStream()
::std::optional< OutputStream > symbolizeOutputStream(::llvm::StringRef str)
::std::optional< EnumType > symbolizeEnum(::llvm::StringRef)
::llvm::StringRef stringifyOutputStream(OutputStream val)
inline ::std::optional< OutputStream > symbolizeEnum< OutputStream >(::llvm::StringRef str)
static unsigned getHashValue(const ::llzk::OutputStream &val)
static inline ::llzk::OutputStream getTombstoneKey()
static inline ::llzk::OutputStream getEmptyKey()
static bool isEqual(const ::llzk::OutputStream &lhs, const ::llzk::OutputStream &rhs)
::llvm::DenseMapInfo< uint32_t > StorageInfo
static FailureOr< std::optional<::llzk::OutputStream > > parse(ParserT &parser)
static FailureOr<::llzk::OutputStream > parse(ParserT &parser)