Types
AnyType dataclass
AnyType()
Bases: TypeAttribute
name class-attribute instance-attribute
name = 'Any'
Name of the attribute in printing and other text format.
BottomType dataclass
BottomType()
Bases: TypeAttribute
name class-attribute instance-attribute
name = 'Bottom'
Name of the attribute in printing and other text format.
is_subseteq
is_subseteq(other: TypeAttribute) -> bool
Subseteq operation.
Source code in src/kirin/ir/attrs/types.py
136 137 138 139 | |
FunctionType dataclass
FunctionType(
params_type: tuple[TypeAttribute, ...],
return_type: TypeAttribute | None = None,
)
Bases: TypeAttribute
Source code in src/kirin/ir/attrs/types.py
771 772 773 774 775 776 777 | |
name class-attribute instance-attribute
name = 'MethodType'
Name of the attribute in printing and other text format.
Generic dataclass
Generic(
body: type[PyClassType] | PyClass[PyClassType],
*vars: TypeAttribute | list | Vararg
)
Bases: TypeAttribute, Generic[PyClassType]
Source code in src/kirin/ir/attrs/types.py
562 563 564 565 566 567 568 569 570 571 | |
name class-attribute instance-attribute
name = 'Generic'
Name of the attribute in printing and other text format.
Literal dataclass
Literal(
data: LiteralType, datatype: TypeAttribute | None = None
)
Bases: TypeAttribute, Generic[LiteralType]
Source code in src/kirin/ir/attrs/types.py
310 311 312 | |
name class-attribute instance-attribute
name = 'Literal'
Name of the attribute in printing and other text format.
type instance-attribute
type: TypeAttribute = datatype or PyClass(type(data))
type of the literal, this is useful when the Python type of data does not represent the type in IR, e.g Literal(1, types.Int32)
PyClass dataclass
PyClass(
typ: type[PyClassType],
*,
display_name: str | None = None,
prefix: str = "py"
)
Bases: TypeAttribute, Generic[PyClassType]
Source code in src/kirin/ir/attrs/types.py
211 212 213 214 215 216 217 218 219 220 | |
name class-attribute instance-attribute
name = 'PyClass'
Name of the attribute in printing and other text format.
SingletonTypeMeta
SingletonTypeMeta(name, bases, attrs)
Bases: TypeAttributeMeta, SingletonMeta
Metaclass for singleton type attributes.
Singleton type attributes are attributes that have only one instance.
Examples: - AnyType - BottomType
Source code in src/kirin/lattice/abc.py
16 17 18 | |
TypeAttribute dataclass
TypeAttribute()
Bases: _TypeAttribute, SimpleMeetMixin['TypeAttribute'], IsSubsetEqMixin['TypeAttribute'], BoundedLattice['TypeAttribute']
join
join(other: TypeAttribute) -> TypeAttribute
Join operation.
Source code in src/kirin/ir/attrs/types.py
73 74 75 76 77 78 79 80 | |
TypeAttributeMeta
Bases: LatticeAttributeMeta
Metaclass for type attributes.
TypeVar dataclass
TypeVar(name: str, bound: TypeAttribute | None = None)
Bases: TypeAttribute
Source code in src/kirin/ir/attrs/types.py
459 460 461 | |
name class-attribute instance-attribute
name = 'TypeVar'
Name of the attribute in printing and other text format.
TypeofMethodType dataclass
TypeofMethodType()
Bases: TypeAttribute
name class-attribute instance-attribute
name = 'TypeofMethodType'
Name of the attribute in printing and other text format.
Union dataclass
Union(
typ_or_set: (
TypeAttribute | typing.Iterable[TypeAttribute]
),
*typs: TypeAttribute
)
Bases: TypeAttribute
Source code in src/kirin/ir/attrs/types.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | |
name class-attribute instance-attribute
name = 'Union'
Name of the attribute in printing and other text format.
join
join(other: TypeAttribute) -> TypeAttribute
Join operation.
Source code in src/kirin/ir/attrs/types.py
402 403 404 405 406 407 408 409 410 411 | |
meet
meet(other: TypeAttribute) -> TypeAttribute
Meet operation.
Source code in src/kirin/ir/attrs/types.py
413 414 415 416 417 418 419 420 421 422 | |
Vararg dataclass
Vararg(typ: TypeAttribute)
Bases: Attribute
name class-attribute instance-attribute
name = 'Vararg'
Name of the attribute in printing and other text format.