32template <
typename EnumType>
43template <
typename T,
typename>
48 template <
typename ParserT>
49 static FailureOr<::llzk::cast::OverflowSemantics>
parse(ParserT &parser) {
51 std::string enumKeyword;
52 auto loc = parser.getCurrentLocation();
53 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
54 return parser.emitError(loc,
"expected keyword for Cast overflow semantics");
59 return parser.emitError(loc,
"invalid Cast overflow semantics specification: ") << enumKeyword;
68struct FieldParser<std::optional<::llzk::cast::OverflowSemantics>, std::optional<::llzk::cast::OverflowSemantics>> {
69 template <
typename ParserT>
70 static FailureOr<std::optional<::llzk::cast::OverflowSemantics>>
parse(ParserT &parser) {
72 std::string enumKeyword;
73 auto loc = parser.getCurrentLocation();
74 if (failed(parser.parseOptionalKeywordOrString(&enumKeyword)))
75 return std::optional<::llzk::cast::OverflowSemantics>{};
80 return parser.emitError(loc,
"invalid Cast overflow semantics specification: ") << enumKeyword;
87 auto valueStr = stringifyEnum(value);
104 static unsigned getHashValue(const ::llzk::cast::OverflowSemantics &val) {
105 return StorageInfo::getHashValue(
static_cast<uint32_t
>(val));
108 static bool isEqual(const ::llzk::cast::OverflowSemantics &lhs, const ::llzk::cast::OverflowSemantics &rhs) {
raw_ostream & operator<<(raw_ostream &os, llvm::PointerUnion< mlir::Value, mlir::Operation * > ptr)
inline ::std::optional< OverflowSemantics > symbolizeEnum< OverflowSemantics >(::llvm::StringRef str)
::std::optional< EnumType > symbolizeEnum(::llvm::StringRef)
::llvm::StringRef stringifyOverflowSemantics(OverflowSemantics val)
constexpr unsigned getMaxEnumValForOverflowSemantics()
inline ::llvm::StringRef stringifyEnum(OverflowSemantics enumValue)
::std::optional< OverflowSemantics > symbolizeOverflowSemantics(::llvm::StringRef str)
static inline ::llzk::cast::OverflowSemantics getTombstoneKey()
static bool isEqual(const ::llzk::cast::OverflowSemantics &lhs, const ::llzk::cast::OverflowSemantics &rhs)
static unsigned getHashValue(const ::llzk::cast::OverflowSemantics &val)
::llvm::DenseMapInfo< uint32_t > StorageInfo
static inline ::llzk::cast::OverflowSemantics getEmptyKey()
static FailureOr< std::optional<::llzk::cast::OverflowSemantics > > parse(ParserT &parser)
static FailureOr<::llzk::cast::OverflowSemantics > parse(ParserT &parser)