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
102 103 104 105 |
|
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
379 380 381 382 383 384 385 386 387 388 |
|
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
229 230 231 |
|
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)
is_equal
is_equal(other: TypeAttribute) -> bool
Check if two lattices are equal.
Source code in src/kirin/ir/attrs/types.py
233 234 |
|
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
158 159 160 161 162 163 164 165 166 167 |
|
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
63 64 65 66 67 68 69 70 |
|
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
323 324 325 |
|
name class-attribute
instance-attribute
name = 'TypeVar'
Name of the attribute in printing and other text format.
is_equal
is_equal(other: TypeAttribute) -> bool
Check if two lattices are equal.
Source code in src/kirin/ir/attrs/types.py
327 328 329 330 331 332 |
|
Union dataclass
Union(
typ_or_set: (
TypeAttribute | typing.Iterable[TypeAttribute]
),
*typs: TypeAttribute
)
Bases: TypeAttribute
Source code in src/kirin/ir/attrs/types.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
|
name class-attribute
instance-attribute
name = 'Union'
Name of the attribute in printing and other text format.
is_equal
is_equal(other: TypeAttribute) -> bool
Check if two lattices are equal.
Source code in src/kirin/ir/attrs/types.py
280 281 |
|
join
join(other: TypeAttribute) -> TypeAttribute
Join operation.
Source code in src/kirin/ir/attrs/types.py
286 287 288 289 290 291 292 293 294 295 |
|
meet
meet(other: TypeAttribute) -> TypeAttribute
Meet operation.
Source code in src/kirin/ir/attrs/types.py
297 298 299 300 301 302 303 304 305 306 |
|
Vararg dataclass
Vararg(typ: TypeAttribute)
Bases: Attribute
name class-attribute
instance-attribute
name = 'Vararg'
Name of the attribute in printing and other text format.