LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
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
12// Specifies the stream to which the pass prints.
13enum class OutputStream : uint32_t {
14 Outs = 1,
15 Errs = 2,
16 Dbgs = 3,
17};
18
19::std::optional<OutputStream> symbolizeOutputStream(uint32_t);
20::llvm::StringRef stringifyOutputStream(OutputStream);
21::std::optional<OutputStream> symbolizeOutputStream(::llvm::StringRef);
22inline constexpr unsigned getMaxEnumValForOutputStream() {
23 return 3;
24}
25
26
27inline ::llvm::StringRef stringifyEnum(OutputStream enumValue) {
28 return stringifyOutputStream(enumValue);
29}
30
31template <typename EnumType>
32::std::optional<EnumType> symbolizeEnum(::llvm::StringRef);
33
34template <>
35inline ::std::optional<OutputStream> symbolizeEnum<OutputStream>(::llvm::StringRef str) {
36 return symbolizeOutputStream(str);
37}
38
39} // namespace llzk
40
41namespace mlir {
42template <typename T, typename>
44
45template<>
47 template <typename ParserT>
48 static FailureOr<::llzk::OutputStream> parse(ParserT &parser) {
49 // Parse the keyword/string containing the enum.
50 std::string enumKeyword;
51 auto loc = parser.getCurrentLocation();
52 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
53 return parser.emitError(loc, "expected keyword for Specifies the stream to which the pass prints.");
54
55 // Symbolize the keyword.
56 if (::std::optional<::llzk::OutputStream> attr = ::llzk::symbolizeEnum<::llzk::OutputStream>(enumKeyword))
57 return *attr;
58 return parser.emitError(loc, "expected one of [outs, errs, dbgs] for Specifies the stream to which the pass prints., got: ") << enumKeyword;
59 }
60};
61
66template<>
67struct FieldParser<std::optional<::llzk::OutputStream>, std::optional<::llzk::OutputStream>> {
68 template <typename ParserT>
69 static FailureOr<std::optional<::llzk::OutputStream>> parse(ParserT &parser) {
70 // Parse the keyword/string containing the enum.
71 std::string enumKeyword;
72 auto loc = parser.getCurrentLocation();
73 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"outs", "errs", "dbgs"})))
74 return std::optional<::llzk::OutputStream>{};
75
76 // Symbolize the keyword.
77 if (::std::optional<::llzk::OutputStream> attr = ::llzk::symbolizeEnum<::llzk::OutputStream>(enumKeyword))
78 return attr;
79 return parser.emitError(loc, "expected one of [outs, errs, dbgs] for Specifies the stream to which the pass prints., got: ") << enumKeyword;
80 }
81};
82} // namespace mlir
83
84namespace llvm {
85inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::llzk::OutputStream value) {
86 auto valueStr = stringifyEnum(value);
87 return p << valueStr;
88}
89} // namespace llvm
90
91namespace llvm {
92template<> struct DenseMapInfo<::llzk::OutputStream> {
93 using StorageInfo = ::llvm::DenseMapInfo<uint32_t>;
94
95 static unsigned getHashValue(const ::llzk::OutputStream &val) {
96 return StorageInfo::getHashValue(static_cast<uint32_t>(val));
97 }
98
99 static bool isEqual(const ::llzk::OutputStream &lhs, const ::llzk::OutputStream &rhs) {
100 return lhs == rhs;
101 }
102};
103}
104
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 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)