Attribute
Attribute
dataclass
Bases: ABC
A compile-time value. Attributes are used to represent SSA variable types, and can be attached on operations to give extra information.
Source code in xdsl/ir/core.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
name: str = field(init=False, repr=False)
class-attribute
The attribute name should be a static field in the attribute classes.
verify() -> None
Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.
Source code in xdsl/ir/core.py
103 104 105 106 107 108 |
|
Data
dataclass
Bases: Generic[DataElement]
, Attribute
, ABC
An attribute represented by a Python structure.
Source code in xdsl/ir/core.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
data: DataElement
instance-attribute
print_parameter(printer: Printer) -> None
abstractmethod
Print the attribute parameter.
Source code in xdsl/ir/core.py
190 191 192 |
|
parse_parameter(parser: AttrParser) -> DataElement
abstractmethod
classmethod
Parse the attribute parameter.
Source code in xdsl/ir/core.py
185 186 187 188 |
|
ParametrizedAttribute
dataclass
Bases: Attribute
An attribute parametrized by other attributes.
Source code in xdsl/ir/core.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
|
parameters: tuple[Attribute, ...] = field()
class-attribute
instance-attribute
print_parameters(printer: Printer) -> None
Print the attribute parameters.
Source code in xdsl/ir/core.py
412 413 414 |
|
parse_parameters(parser: AttrParser) -> Sequence[Attribute]
classmethod
Parse the attribute parameters.
Source code in xdsl/ir/core.py
407 408 409 410 |
|
get_irdl_definition() -> ParamAttrDef
classmethod
Get the IRDL attribute definition.
Source code in xdsl/ir/core.py
416 417 418 419 |
|
TypedAttribute
dataclass
Bases: ParametrizedAttribute
, ABC
An attribute with a type.
Source code in xdsl/ir/core.py
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
|