C type context
c_type_context
CFuncSignature
Bases: NamedTuple
C function signature.
Source code in xdsl/jit/c_type_context.py
9 10 11 12 13 | |
inputs: tuple[str, ...]
instance-attribute
output: str
instance-attribute
CTypeContext
Registry of xDSL attribute classes to C type converters.
Source code in xdsl/jit/c_type_context.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
registry: dict[type[Attribute], Callable[[Any], str]] = {}
instance-attribute
Map from an xDSL attribute class to a converter producing its C type.
__init__() -> None
Source code in xdsl/jit/c_type_context.py
22 23 | |
register_type(attr_type: type[Attribute], converter: Callable[[Any], str]) -> None
Register how attr_type instances map to a C type.
Source code in xdsl/jit/c_type_context.py
25 26 27 28 29 30 31 | |
to_c_type(type_attr: Attribute) -> str
Return the C type for type_attr.
Source code in xdsl/jit/c_type_context.py
33 34 35 36 37 38 39 | |
to_c_func_type(inputs: Iterable[Attribute], output: Attribute) -> CFuncSignature
Build a C function signature from IR argument and result types.
Source code in xdsl/jit/c_type_context.py
41 42 43 44 45 46 47 | |
register_builtin_types(ctx: CTypeContext) -> None
Source code in xdsl/jit/c_type_context.py
67 68 69 70 71 | |