C type context
c_type_context
CTypeContext
Registry of xDSL attribute classes to ctypes converters.
Source code in xdsl/jit/c_type_context.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
registry: dict[type[Attribute], Callable[[Any], Any]] = {}
instance-attribute
Map from an xDSL attribute class to a converter producing its ctypes type.
__init__() -> None
Source code in xdsl/jit/c_type_context.py
16 17 | |
register_ctype(attr_type: type[Attribute], converter: Callable[[Any], Any]) -> None
Register how attr_type instances map to a ctypes type.
Source code in xdsl/jit/c_type_context.py
19 20 21 22 23 24 25 | |
to_ctype(type_attr: Attribute) -> Any
Return the ctypes type class for type_attr.
Source code in xdsl/jit/c_type_context.py
27 28 29 30 31 32 33 | |
to_c_func_type(inputs: Iterable[Attribute], output: Attribute)
Build a CFUNCTYPE from IR argument and result types.
Source code in xdsl/jit/c_type_context.py
35 36 37 38 39 | |
register_builtin_ctypes(ctx: CTypeContext) -> None
Source code in xdsl/jit/c_type_context.py
59 60 61 62 63 | |