/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Enum Utility Declarations *| |* *| |* Automatically generated file, do not edit! *| |* From: OpenMPOps.td *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::omp { // access group modifier enum class AccessGroupModifier : uint32_t { cgroup = 0, }; ::std::optional symbolizeAccessGroupModifier(uint32_t); ::llvm::StringRef stringifyAccessGroupModifier(AccessGroupModifier); ::std::optional symbolizeAccessGroupModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForAccessGroupModifier() { return 0; } inline ::llvm::StringRef stringifyEnum(AccessGroupModifier enumValue) { return stringifyAccessGroupModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeAccessGroupModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::AccessGroupModifier, ::mlir::omp::AccessGroupModifier> { template static FailureOr<::mlir::omp::AccessGroupModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for access group modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::AccessGroupModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::AccessGroupModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [cgroup] for access group modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::AccessGroupModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"cgroup"}))) return std::optional<::mlir::omp::AccessGroupModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::AccessGroupModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::AccessGroupModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [cgroup] for access group modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::AccessGroupModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::AccessGroupModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::AccessGroupModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::AccessGroupModifier &lhs, const ::mlir::omp::AccessGroupModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // BindKind Clause enum class ClauseBindKind : uint32_t { Parallel = 0, Teams = 1, Thread = 2, }; ::std::optional symbolizeClauseBindKind(uint32_t); ::llvm::StringRef stringifyClauseBindKind(ClauseBindKind); ::std::optional symbolizeClauseBindKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseBindKind() { return 2; } inline ::llvm::StringRef stringifyEnum(ClauseBindKind enumValue) { return stringifyClauseBindKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseBindKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseBindKind, ::mlir::omp::ClauseBindKind> { template static FailureOr<::mlir::omp::ClauseBindKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for BindKind Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseBindKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseBindKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [parallel, teams, thread] for BindKind Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseBindKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"parallel", "teams", "thread"}))) return std::optional<::mlir::omp::ClauseBindKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseBindKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseBindKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [parallel, teams, thread] for BindKind Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseBindKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseBindKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseBindKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseBindKind &lhs, const ::mlir::omp::ClauseBindKind &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // CancellationConstructType Clause enum class ClauseCancellationConstructType : uint32_t { Parallel = 0, Loop = 1, Sections = 2, Taskgroup = 3, }; ::std::optional symbolizeClauseCancellationConstructType(uint32_t); ::llvm::StringRef stringifyClauseCancellationConstructType(ClauseCancellationConstructType); ::std::optional symbolizeClauseCancellationConstructType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseCancellationConstructType() { return 3; } inline ::llvm::StringRef stringifyEnum(ClauseCancellationConstructType enumValue) { return stringifyClauseCancellationConstructType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseCancellationConstructType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseCancellationConstructType, ::mlir::omp::ClauseCancellationConstructType> { template static FailureOr<::mlir::omp::ClauseCancellationConstructType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for CancellationConstructType Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseCancellationConstructType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseCancellationConstructType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [parallel, loop, sections, taskgroup] for CancellationConstructType Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseCancellationConstructType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"parallel", "loop", "sections", "taskgroup"}))) return std::optional<::mlir::omp::ClauseCancellationConstructType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseCancellationConstructType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseCancellationConstructType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [parallel, loop, sections, taskgroup] for CancellationConstructType Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseCancellationConstructType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseCancellationConstructType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseCancellationConstructType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseCancellationConstructType &lhs, const ::mlir::omp::ClauseCancellationConstructType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // depend clause enum class ClauseDepend : uint32_t { dependsource = 0, dependsink = 1, }; ::std::optional symbolizeClauseDepend(uint32_t); ::llvm::StringRef stringifyClauseDepend(ClauseDepend); ::std::optional symbolizeClauseDepend(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseDepend() { return 1; } inline ::llvm::StringRef stringifyEnum(ClauseDepend enumValue) { return stringifyClauseDepend(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseDepend(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseDepend, ::mlir::omp::ClauseDepend> { template static FailureOr<::mlir::omp::ClauseDepend> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for depend clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseDepend> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseDepend>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [dependsource, dependsink] for depend clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseDepend>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"dependsource", "dependsink"}))) return std::optional<::mlir::omp::ClauseDepend>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseDepend> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseDepend>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [dependsource, dependsink] for depend clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseDepend value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseDepend> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseDepend &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseDepend &lhs, const ::mlir::omp::ClauseDepend &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // Map types and modifiers tied to data maps enum class ClauseMapFlags : uint32_t { none = 0, storage = 1, to = 2, from = 4, always = 8, del = 16, return_param = 32, priv = 64, literal = 128, implicit = 256, close = 512, present = 1024, ompx_hold = 2048, attach = 4096, attach_always = 8192, attach_never = 16384, attach_auto = 32768, ref_ptr = 65536, ref_ptee = 131072, is_device_ptr = 262144, }; ::std::optional symbolizeClauseMapFlags(uint32_t); std::string stringifyClauseMapFlags(ClauseMapFlags); ::std::optional symbolizeClauseMapFlags(::llvm::StringRef); inline constexpr ClauseMapFlags operator|(ClauseMapFlags a, ClauseMapFlags b) { return static_cast(static_cast(a) | static_cast(b)); } inline constexpr ClauseMapFlags operator&(ClauseMapFlags a, ClauseMapFlags b) { return static_cast(static_cast(a) & static_cast(b)); } inline constexpr ClauseMapFlags operator^(ClauseMapFlags a, ClauseMapFlags b) { return static_cast(static_cast(a) ^ static_cast(b)); } inline constexpr ClauseMapFlags &operator|=(ClauseMapFlags &a, ClauseMapFlags b) { return a = a | b; } inline constexpr ClauseMapFlags &operator&=(ClauseMapFlags &a, ClauseMapFlags b) { return a = a & b; } inline constexpr ClauseMapFlags &operator^=(ClauseMapFlags &a, ClauseMapFlags b) { return a = a ^ b; } inline constexpr ClauseMapFlags operator~(ClauseMapFlags bits) { // Ensure only bits that can be present in the enum are set return static_cast(~static_cast(bits) & static_cast(524287u)); } inline constexpr bool bitEnumContainsAll(ClauseMapFlags bits, ClauseMapFlags bit) { return (bits & bit) == bit; } inline constexpr bool bitEnumContainsAny(ClauseMapFlags bits, ClauseMapFlags bit) { return (static_cast(bits) & static_cast(bit)) != 0; } inline constexpr ClauseMapFlags bitEnumClear(ClauseMapFlags bits, ClauseMapFlags bit) { return bits & ~bit; } inline constexpr ClauseMapFlags bitEnumSet(ClauseMapFlags bits, ClauseMapFlags bit, /*optional*/bool value=true) { return value ? (bits | bit) : bitEnumClear(bits, bit); } inline std::string stringifyEnum(ClauseMapFlags enumValue) { return stringifyClauseMapFlags(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseMapFlags(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseMapFlags, ::mlir::omp::ClauseMapFlags> { template static FailureOr<::mlir::omp::ClauseMapFlags> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Map types and modifiers tied to data maps"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseMapFlags> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseMapFlags>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [none, storage, to, from, always, del, return_param, priv, literal, implicit, close, present, ompx_hold, attach, attach_always, attach_never, attach_auto, ref_ptr, ref_ptee, is_device_ptr] for Map types and modifiers tied to data maps, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseMapFlags>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"none", "storage", "to", "from", "always", "del", "return_param", "priv", "literal", "implicit", "close", "present", "ompx_hold", "attach", "attach_always", "attach_never", "attach_auto", "ref_ptr", "ref_ptee", "is_device_ptr"}))) return std::optional<::mlir::omp::ClauseMapFlags>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseMapFlags> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseMapFlags>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [none, storage, to, from, always, del, return_param, priv, literal, implicit, close, present, ompx_hold, attach, attach_always, attach_never, attach_auto, ref_ptr, ref_ptee, is_device_ptr] for Map types and modifiers tied to data maps, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseMapFlags value) { auto valueStr = stringifyEnum(value); auto underlyingValue = static_cast>(value); if (underlyingValue && !llvm::has_single_bit(underlyingValue)) return p << '"' << valueStr << '"'; return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseMapFlags> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseMapFlags &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseMapFlags &lhs, const ::mlir::omp::ClauseMapFlags &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // requires clauses enum class ClauseRequires : uint32_t { none = 0, reverse_offload = 1, unified_address = 2, unified_shared_memory = 4, dynamic_allocators = 8, }; ::std::optional symbolizeClauseRequires(uint32_t); std::string stringifyClauseRequires(ClauseRequires); ::std::optional symbolizeClauseRequires(::llvm::StringRef); inline constexpr ClauseRequires operator|(ClauseRequires a, ClauseRequires b) { return static_cast(static_cast(a) | static_cast(b)); } inline constexpr ClauseRequires operator&(ClauseRequires a, ClauseRequires b) { return static_cast(static_cast(a) & static_cast(b)); } inline constexpr ClauseRequires operator^(ClauseRequires a, ClauseRequires b) { return static_cast(static_cast(a) ^ static_cast(b)); } inline constexpr ClauseRequires &operator|=(ClauseRequires &a, ClauseRequires b) { return a = a | b; } inline constexpr ClauseRequires &operator&=(ClauseRequires &a, ClauseRequires b) { return a = a & b; } inline constexpr ClauseRequires &operator^=(ClauseRequires &a, ClauseRequires b) { return a = a ^ b; } inline constexpr ClauseRequires operator~(ClauseRequires bits) { // Ensure only bits that can be present in the enum are set return static_cast(~static_cast(bits) & static_cast(15u)); } inline constexpr bool bitEnumContainsAll(ClauseRequires bits, ClauseRequires bit) { return (bits & bit) == bit; } inline constexpr bool bitEnumContainsAny(ClauseRequires bits, ClauseRequires bit) { return (static_cast(bits) & static_cast(bit)) != 0; } inline constexpr ClauseRequires bitEnumClear(ClauseRequires bits, ClauseRequires bit) { return bits & ~bit; } inline constexpr ClauseRequires bitEnumSet(ClauseRequires bits, ClauseRequires bit, /*optional*/bool value=true) { return value ? (bits | bit) : bitEnumClear(bits, bit); } inline std::string stringifyEnum(ClauseRequires enumValue) { return stringifyClauseRequires(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseRequires(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseRequires, ::mlir::omp::ClauseRequires> { template static FailureOr<::mlir::omp::ClauseRequires> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for requires clauses"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseRequires> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseRequires>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [none, reverse_offload, unified_address, unified_shared_memory, dynamic_allocators] for requires clauses, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseRequires>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"none", "reverse_offload", "unified_address", "unified_shared_memory", "dynamic_allocators"}))) return std::optional<::mlir::omp::ClauseRequires>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseRequires> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseRequires>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [none, reverse_offload, unified_address, unified_shared_memory, dynamic_allocators] for requires clauses, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseRequires value) { auto valueStr = stringifyEnum(value); auto underlyingValue = static_cast>(value); if (underlyingValue && !llvm::has_single_bit(underlyingValue)) return p << '"' << valueStr << '"'; return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseRequires> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseRequires &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseRequires &lhs, const ::mlir::omp::ClauseRequires &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // depend clause in a target or task construct enum class ClauseTaskDepend : uint32_t { taskdependin = 0, taskdependout = 1, taskdependinout = 2, taskdependmutexinoutset = 3, taskdependinoutset = 4, }; ::std::optional symbolizeClauseTaskDepend(uint32_t); ::llvm::StringRef stringifyClauseTaskDepend(ClauseTaskDepend); ::std::optional symbolizeClauseTaskDepend(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseTaskDepend() { return 4; } inline ::llvm::StringRef stringifyEnum(ClauseTaskDepend enumValue) { return stringifyClauseTaskDepend(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseTaskDepend(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseTaskDepend, ::mlir::omp::ClauseTaskDepend> { template static FailureOr<::mlir::omp::ClauseTaskDepend> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for depend clause in a target or task construct"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseTaskDepend> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseTaskDepend>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [taskdependin, taskdependout, taskdependinout, taskdependmutexinoutset, taskdependinoutset] for depend clause in a target or task construct, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseTaskDepend>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"taskdependin", "taskdependout", "taskdependinout", "taskdependmutexinoutset", "taskdependinoutset"}))) return std::optional<::mlir::omp::ClauseTaskDepend>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseTaskDepend> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseTaskDepend>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [taskdependin, taskdependout, taskdependinout, taskdependmutexinoutset, taskdependinoutset] for depend clause in a target or task construct, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseTaskDepend value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseTaskDepend> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseTaskDepend &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseTaskDepend &lhs, const ::mlir::omp::ClauseTaskDepend &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // Type of a data-sharing clause enum class DataSharingClauseType : uint32_t { Private = 0, FirstPrivate = 1, }; ::std::optional symbolizeDataSharingClauseType(uint32_t); ::llvm::StringRef stringifyDataSharingClauseType(DataSharingClauseType); ::std::optional symbolizeDataSharingClauseType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForDataSharingClauseType() { return 1; } inline ::llvm::StringRef stringifyEnum(DataSharingClauseType enumValue) { return stringifyDataSharingClauseType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeDataSharingClauseType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::DataSharingClauseType, ::mlir::omp::DataSharingClauseType> { template static FailureOr<::mlir::omp::DataSharingClauseType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Type of a data-sharing clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::DataSharingClauseType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DataSharingClauseType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [private, firstprivate] for Type of a data-sharing clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::DataSharingClauseType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"private", "firstprivate"}))) return std::optional<::mlir::omp::DataSharingClauseType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::DataSharingClauseType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DataSharingClauseType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [private, firstprivate] for Type of a data-sharing clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::DataSharingClauseType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::DataSharingClauseType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::DataSharingClauseType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::DataSharingClauseType &lhs, const ::mlir::omp::DataSharingClauseType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // capture clause enum class DeclareTargetCaptureClause : uint32_t { none = 0, to = 1, link = 2, enter = 3, }; ::std::optional symbolizeDeclareTargetCaptureClause(uint32_t); ::llvm::StringRef stringifyDeclareTargetCaptureClause(DeclareTargetCaptureClause); ::std::optional symbolizeDeclareTargetCaptureClause(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForDeclareTargetCaptureClause() { return 3; } inline ::llvm::StringRef stringifyEnum(DeclareTargetCaptureClause enumValue) { return stringifyDeclareTargetCaptureClause(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeDeclareTargetCaptureClause(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::DeclareTargetCaptureClause, ::mlir::omp::DeclareTargetCaptureClause> { template static FailureOr<::mlir::omp::DeclareTargetCaptureClause> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for capture clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::DeclareTargetCaptureClause> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DeclareTargetCaptureClause>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [none, to, link, enter] for capture clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::DeclareTargetCaptureClause>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"none", "to", "link", "enter"}))) return std::optional<::mlir::omp::DeclareTargetCaptureClause>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::DeclareTargetCaptureClause> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DeclareTargetCaptureClause>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [none, to, link, enter] for capture clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::DeclareTargetCaptureClause value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::DeclareTargetCaptureClause> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::DeclareTargetCaptureClause &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::DeclareTargetCaptureClause &lhs, const ::mlir::omp::DeclareTargetCaptureClause &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // device_type clause enum class DeclareTargetDeviceType : uint32_t { any = 0, host = 1, nohost = 2, }; ::std::optional symbolizeDeclareTargetDeviceType(uint32_t); ::llvm::StringRef stringifyDeclareTargetDeviceType(DeclareTargetDeviceType); ::std::optional symbolizeDeclareTargetDeviceType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForDeclareTargetDeviceType() { return 2; } inline ::llvm::StringRef stringifyEnum(DeclareTargetDeviceType enumValue) { return stringifyDeclareTargetDeviceType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeDeclareTargetDeviceType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::DeclareTargetDeviceType, ::mlir::omp::DeclareTargetDeviceType> { template static FailureOr<::mlir::omp::DeclareTargetDeviceType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for device_type clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::DeclareTargetDeviceType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DeclareTargetDeviceType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [any, host, nohost] for device_type clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::DeclareTargetDeviceType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"any", "host", "nohost"}))) return std::optional<::mlir::omp::DeclareTargetDeviceType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::DeclareTargetDeviceType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::DeclareTargetDeviceType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [any, host, nohost] for device_type clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::DeclareTargetDeviceType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::DeclareTargetDeviceType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::DeclareTargetDeviceType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::DeclareTargetDeviceType &lhs, const ::mlir::omp::DeclareTargetDeviceType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // fallback modifier enum class FallbackModifier : uint32_t { abort = 0, null = 1, default_mem = 2, }; ::std::optional symbolizeFallbackModifier(uint32_t); ::llvm::StringRef stringifyFallbackModifier(FallbackModifier); ::std::optional symbolizeFallbackModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForFallbackModifier() { return 2; } inline ::llvm::StringRef stringifyEnum(FallbackModifier enumValue) { return stringifyFallbackModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeFallbackModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::FallbackModifier, ::mlir::omp::FallbackModifier> { template static FailureOr<::mlir::omp::FallbackModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for fallback modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::FallbackModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::FallbackModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [abort, null, default_mem] for fallback modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::FallbackModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"abort", "null", "default_mem"}))) return std::optional<::mlir::omp::FallbackModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::FallbackModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::FallbackModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [abort, null, default_mem] for fallback modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::FallbackModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::FallbackModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::FallbackModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::FallbackModifier &lhs, const ::mlir::omp::FallbackModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // GrainsizeType Clause enum class ClauseGrainsizeType : uint32_t { Strict = 0, }; ::std::optional symbolizeClauseGrainsizeType(uint32_t); ::llvm::StringRef stringifyClauseGrainsizeType(ClauseGrainsizeType); ::std::optional symbolizeClauseGrainsizeType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseGrainsizeType() { return 0; } inline ::llvm::StringRef stringifyEnum(ClauseGrainsizeType enumValue) { return stringifyClauseGrainsizeType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseGrainsizeType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseGrainsizeType, ::mlir::omp::ClauseGrainsizeType> { template static FailureOr<::mlir::omp::ClauseGrainsizeType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for GrainsizeType Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseGrainsizeType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseGrainsizeType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [strict] for GrainsizeType Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseGrainsizeType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"strict"}))) return std::optional<::mlir::omp::ClauseGrainsizeType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseGrainsizeType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseGrainsizeType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [strict] for GrainsizeType Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseGrainsizeType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseGrainsizeType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseGrainsizeType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseGrainsizeType &lhs, const ::mlir::omp::ClauseGrainsizeType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // linear modifier enum class LinearModifier : uint32_t { val = 0, ref = 1, uval = 2, }; ::std::optional symbolizeLinearModifier(uint32_t); ::llvm::StringRef stringifyLinearModifier(LinearModifier); ::std::optional symbolizeLinearModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForLinearModifier() { return 2; } inline ::llvm::StringRef stringifyEnum(LinearModifier enumValue) { return stringifyLinearModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeLinearModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::LinearModifier, ::mlir::omp::LinearModifier> { template static FailureOr<::mlir::omp::LinearModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for linear modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::LinearModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::LinearModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [val, ref, uval] for linear modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::LinearModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"val", "ref", "uval"}))) return std::optional<::mlir::omp::LinearModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::LinearModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::LinearModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [val, ref, uval] for linear modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::LinearModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::LinearModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::LinearModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::LinearModifier &lhs, const ::mlir::omp::LinearModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // MemoryOrderKind Clause enum class ClauseMemoryOrderKind : uint32_t { Seq_cst = 0, Acq_rel = 1, Acquire = 2, Release = 3, Relaxed = 4, }; ::std::optional symbolizeClauseMemoryOrderKind(uint32_t); ::llvm::StringRef stringifyClauseMemoryOrderKind(ClauseMemoryOrderKind); ::std::optional symbolizeClauseMemoryOrderKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseMemoryOrderKind() { return 4; } inline ::llvm::StringRef stringifyEnum(ClauseMemoryOrderKind enumValue) { return stringifyClauseMemoryOrderKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseMemoryOrderKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseMemoryOrderKind, ::mlir::omp::ClauseMemoryOrderKind> { template static FailureOr<::mlir::omp::ClauseMemoryOrderKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for MemoryOrderKind Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseMemoryOrderKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseMemoryOrderKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [seq_cst, acq_rel, acquire, release, relaxed] for MemoryOrderKind Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseMemoryOrderKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"seq_cst", "acq_rel", "acquire", "release", "relaxed"}))) return std::optional<::mlir::omp::ClauseMemoryOrderKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseMemoryOrderKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseMemoryOrderKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [seq_cst, acq_rel, acquire, release, relaxed] for MemoryOrderKind Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseMemoryOrderKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseMemoryOrderKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseMemoryOrderKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseMemoryOrderKind &lhs, const ::mlir::omp::ClauseMemoryOrderKind &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // NumTasksType Clause enum class ClauseNumTasksType : uint32_t { Strict = 0, }; ::std::optional symbolizeClauseNumTasksType(uint32_t); ::llvm::StringRef stringifyClauseNumTasksType(ClauseNumTasksType); ::std::optional symbolizeClauseNumTasksType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseNumTasksType() { return 0; } inline ::llvm::StringRef stringifyEnum(ClauseNumTasksType enumValue) { return stringifyClauseNumTasksType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseNumTasksType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseNumTasksType, ::mlir::omp::ClauseNumTasksType> { template static FailureOr<::mlir::omp::ClauseNumTasksType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for NumTasksType Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseNumTasksType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseNumTasksType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [strict] for NumTasksType Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseNumTasksType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"strict"}))) return std::optional<::mlir::omp::ClauseNumTasksType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseNumTasksType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseNumTasksType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [strict] for NumTasksType Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseNumTasksType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseNumTasksType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseNumTasksType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseNumTasksType &lhs, const ::mlir::omp::ClauseNumTasksType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // NumThreadsType Clause enum class ClauseNumThreadsType : uint32_t { Strict = 0, }; ::std::optional symbolizeClauseNumThreadsType(uint32_t); ::llvm::StringRef stringifyClauseNumThreadsType(ClauseNumThreadsType); ::std::optional symbolizeClauseNumThreadsType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseNumThreadsType() { return 0; } inline ::llvm::StringRef stringifyEnum(ClauseNumThreadsType enumValue) { return stringifyClauseNumThreadsType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseNumThreadsType(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseNumThreadsType, ::mlir::omp::ClauseNumThreadsType> { template static FailureOr<::mlir::omp::ClauseNumThreadsType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for NumThreadsType Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseNumThreadsType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseNumThreadsType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [strict] for NumThreadsType Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseNumThreadsType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"strict"}))) return std::optional<::mlir::omp::ClauseNumThreadsType>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseNumThreadsType> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseNumThreadsType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [strict] for NumThreadsType Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseNumThreadsType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseNumThreadsType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseNumThreadsType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseNumThreadsType &lhs, const ::mlir::omp::ClauseNumThreadsType &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // OrderKind Clause enum class ClauseOrderKind : uint32_t { Concurrent = 1, }; ::std::optional symbolizeClauseOrderKind(uint32_t); ::llvm::StringRef stringifyClauseOrderKind(ClauseOrderKind); ::std::optional symbolizeClauseOrderKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseOrderKind() { return 1; } inline ::llvm::StringRef stringifyEnum(ClauseOrderKind enumValue) { return stringifyClauseOrderKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseOrderKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseOrderKind, ::mlir::omp::ClauseOrderKind> { template static FailureOr<::mlir::omp::ClauseOrderKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for OrderKind Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseOrderKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseOrderKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [concurrent] for OrderKind Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseOrderKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"concurrent"}))) return std::optional<::mlir::omp::ClauseOrderKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseOrderKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseOrderKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [concurrent] for OrderKind Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseOrderKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseOrderKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseOrderKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseOrderKind &lhs, const ::mlir::omp::ClauseOrderKind &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // OpenMP Order Modifier enum class OrderModifier : uint32_t { reproducible = 0, unconstrained = 1, }; ::std::optional symbolizeOrderModifier(uint32_t); ::llvm::StringRef stringifyOrderModifier(OrderModifier); ::std::optional symbolizeOrderModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForOrderModifier() { return 1; } inline ::llvm::StringRef stringifyEnum(OrderModifier enumValue) { return stringifyOrderModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeOrderModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::OrderModifier, ::mlir::omp::OrderModifier> { template static FailureOr<::mlir::omp::OrderModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for OpenMP Order Modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::OrderModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::OrderModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [reproducible, unconstrained] for OpenMP Order Modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::OrderModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"reproducible", "unconstrained"}))) return std::optional<::mlir::omp::OrderModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::OrderModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::OrderModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [reproducible, unconstrained] for OpenMP Order Modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::OrderModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::OrderModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::OrderModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::OrderModifier &lhs, const ::mlir::omp::OrderModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // ProcBindKind Clause enum class ClauseProcBindKind : uint32_t { Primary = 0, Master = 1, Close = 2, Spread = 3, }; ::std::optional symbolizeClauseProcBindKind(uint32_t); ::llvm::StringRef stringifyClauseProcBindKind(ClauseProcBindKind); ::std::optional symbolizeClauseProcBindKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseProcBindKind() { return 3; } inline ::llvm::StringRef stringifyEnum(ClauseProcBindKind enumValue) { return stringifyClauseProcBindKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseProcBindKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseProcBindKind, ::mlir::omp::ClauseProcBindKind> { template static FailureOr<::mlir::omp::ClauseProcBindKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for ProcBindKind Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseProcBindKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseProcBindKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [primary, master, close, spread] for ProcBindKind Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseProcBindKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"primary", "master", "close", "spread"}))) return std::optional<::mlir::omp::ClauseProcBindKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseProcBindKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseProcBindKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [primary, master, close, spread] for ProcBindKind Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseProcBindKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseProcBindKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseProcBindKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseProcBindKind &lhs, const ::mlir::omp::ClauseProcBindKind &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // reduction modifier enum class ReductionModifier : uint32_t { defaultmod = 0, inscan = 1, task = 2, }; ::std::optional symbolizeReductionModifier(uint32_t); ::llvm::StringRef stringifyReductionModifier(ReductionModifier); ::std::optional symbolizeReductionModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForReductionModifier() { return 2; } inline ::llvm::StringRef stringifyEnum(ReductionModifier enumValue) { return stringifyReductionModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeReductionModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ReductionModifier, ::mlir::omp::ReductionModifier> { template static FailureOr<::mlir::omp::ReductionModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for reduction modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ReductionModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ReductionModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [defaultmod, inscan, task] for reduction modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ReductionModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"defaultmod", "inscan", "task"}))) return std::optional<::mlir::omp::ReductionModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ReductionModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ReductionModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [defaultmod, inscan, task] for reduction modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ReductionModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ReductionModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ReductionModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ReductionModifier &lhs, const ::mlir::omp::ReductionModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // ScheduleKind Clause enum class ClauseScheduleKind : uint32_t { Static = 0, Dynamic = 1, Guided = 2, Auto = 3, Runtime = 4, Distribute = 5, }; ::std::optional symbolizeClauseScheduleKind(uint32_t); ::llvm::StringRef stringifyClauseScheduleKind(ClauseScheduleKind); ::std::optional symbolizeClauseScheduleKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForClauseScheduleKind() { return 5; } inline ::llvm::StringRef stringifyEnum(ClauseScheduleKind enumValue) { return stringifyClauseScheduleKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeClauseScheduleKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ClauseScheduleKind, ::mlir::omp::ClauseScheduleKind> { template static FailureOr<::mlir::omp::ClauseScheduleKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for ScheduleKind Clause"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseScheduleKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseScheduleKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [static, dynamic, guided, auto, runtime, distribute] for ScheduleKind Clause, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ClauseScheduleKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"static", "dynamic", "guided", "auto", "runtime", "distribute"}))) return std::optional<::mlir::omp::ClauseScheduleKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ClauseScheduleKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ClauseScheduleKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [static, dynamic, guided, auto, runtime, distribute] for ScheduleKind Clause, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ClauseScheduleKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ClauseScheduleKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ClauseScheduleKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ClauseScheduleKind &lhs, const ::mlir::omp::ClauseScheduleKind &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // OpenMP Schedule Modifier enum class ScheduleModifier : uint32_t { none = 0, monotonic = 1, nonmonotonic = 2, simd = 3, }; ::std::optional symbolizeScheduleModifier(uint32_t); ::llvm::StringRef stringifyScheduleModifier(ScheduleModifier); ::std::optional symbolizeScheduleModifier(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForScheduleModifier() { return 3; } inline ::llvm::StringRef stringifyEnum(ScheduleModifier enumValue) { return stringifyScheduleModifier(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeScheduleModifier(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::ScheduleModifier, ::mlir::omp::ScheduleModifier> { template static FailureOr<::mlir::omp::ScheduleModifier> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for OpenMP Schedule Modifier"); // Symbolize the keyword. if (::std::optional<::mlir::omp::ScheduleModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ScheduleModifier>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [none, monotonic, nonmonotonic, simd] for OpenMP Schedule Modifier, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::ScheduleModifier>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"none", "monotonic", "nonmonotonic", "simd"}))) return std::optional<::mlir::omp::ScheduleModifier>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::ScheduleModifier> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::ScheduleModifier>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [none, monotonic, nonmonotonic, simd] for OpenMP Schedule Modifier, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::ScheduleModifier value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::ScheduleModifier> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::ScheduleModifier &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::ScheduleModifier &lhs, const ::mlir::omp::ScheduleModifier &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // target execution mode, mirroring the `OMPTgtExecModeFlags` LLVM enum enum class TargetExecMode : uint32_t { bare = 0, generic = 1, spmd = 2, no_loop = 3, }; ::std::optional symbolizeTargetExecMode(uint32_t); ::llvm::StringRef stringifyTargetExecMode(TargetExecMode); ::std::optional symbolizeTargetExecMode(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForTargetExecMode() { return 3; } inline ::llvm::StringRef stringifyEnum(TargetExecMode enumValue) { return stringifyTargetExecMode(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeTargetExecMode(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::TargetExecMode, ::mlir::omp::TargetExecMode> { template static FailureOr<::mlir::omp::TargetExecMode> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for target execution mode, mirroring the `OMPTgtExecModeFlags` LLVM enum"); // Symbolize the keyword. if (::std::optional<::mlir::omp::TargetExecMode> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::TargetExecMode>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [bare, generic, spmd, no_loop] for target execution mode, mirroring the `OMPTgtExecModeFlags` LLVM enum, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::TargetExecMode>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bare", "generic", "spmd", "no_loop"}))) return std::optional<::mlir::omp::TargetExecMode>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::TargetExecMode> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::TargetExecMode>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [bare, generic, spmd, no_loop] for target execution mode, mirroring the `OMPTgtExecModeFlags` LLVM enum, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::TargetExecMode value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::TargetExecMode> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::TargetExecMode &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::TargetExecMode &lhs, const ::mlir::omp::TargetExecMode &rhs) { return lhs == rhs; } }; } namespace mlir::omp { // variable capture kind enum class VariableCaptureKind : uint32_t { This = 0, ByRef = 1, ByCopy = 2, VLAType = 3, }; ::std::optional symbolizeVariableCaptureKind(uint32_t); ::llvm::StringRef stringifyVariableCaptureKind(VariableCaptureKind); ::std::optional symbolizeVariableCaptureKind(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForVariableCaptureKind() { return 3; } inline ::llvm::StringRef stringifyEnum(VariableCaptureKind enumValue) { return stringifyVariableCaptureKind(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeVariableCaptureKind(str); } } // namespace mlir::omp namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::omp::VariableCaptureKind, ::mlir::omp::VariableCaptureKind> { template static FailureOr<::mlir::omp::VariableCaptureKind> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for variable capture kind"); // Symbolize the keyword. if (::std::optional<::mlir::omp::VariableCaptureKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::VariableCaptureKind>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [This, ByRef, ByCopy, VLAType] for variable capture kind, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::omp::VariableCaptureKind>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"This", "ByRef", "ByCopy", "VLAType"}))) return std::optional<::mlir::omp::VariableCaptureKind>{}; // Symbolize the keyword. if (::std::optional<::mlir::omp::VariableCaptureKind> attr = ::mlir::omp::symbolizeEnum<::mlir::omp::VariableCaptureKind>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [This, ByRef, ByCopy, VLAType] for variable capture kind, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::omp::VariableCaptureKind value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::omp::VariableCaptureKind> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::omp::VariableCaptureKind &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::omp::VariableCaptureKind &lhs, const ::mlir::omp::VariableCaptureKind &rhs) { return lhs == rhs; } }; }