
# Autogenerated by mlir-tblgen; don't manually edit.

from enum import IntEnum, auto, IntFlag
from ._ods_common import _cext as _ods_cext
from ..ir import register_attribute_builder
_ods_ir = _ods_cext.ir

class FailurePropagationMode(IntEnum):
    """Silenceable error propagation policy"""

    Propagate = 1
    Suppress = 2

    def __str__(self):
        if self is FailurePropagationMode.Propagate:
            return "propagate"
        if self is FailurePropagationMode.Suppress:
            return "suppress"
        raise ValueError("Unknown FailurePropagationMode enum entry.")



@register_attribute_builder("FailurePropagationMode", allow_existing=True)
def _failurepropagationmode(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

class MatchCmpIPredicate(IntEnum):
    """allowed 32-bit signless integer cases: 0, 1, 2, 3, 4, 5"""

    eq = 0
    ne = 1
    lt = 2
    le = 3
    gt = 4
    ge = 5

    def __str__(self):
        if self is MatchCmpIPredicate.eq:
            return "eq"
        if self is MatchCmpIPredicate.ne:
            return "ne"
        if self is MatchCmpIPredicate.lt:
            return "lt"
        if self is MatchCmpIPredicate.le:
            return "le"
        if self is MatchCmpIPredicate.gt:
            return "gt"
        if self is MatchCmpIPredicate.ge:
            return "ge"
        raise ValueError("Unknown MatchCmpIPredicate enum entry.")



@register_attribute_builder("MatchCmpIPredicateAttr", allow_existing=True)
def _matchcmpipredicateattr(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

