Skip to content

C type context

c_type_context

register_llvm_types(ctx: CTypeContext) -> None

Source code in xdsl/jit/llvm/c_type_context.py
6
7
8
def register_llvm_types(ctx: CTypeContext) -> None:
    ctx.register_type(LLVMPointerType, lambda _: "void *")
    ctx.register_type(LLVMVoidType, lambda _: "void")

to_c_func_type(ctx: CTypeContext, func_type: LLVMFunctionType)

Build a C function signature from an LLVM function type.

Source code in xdsl/jit/llvm/c_type_context.py
11
12
13
14
15
def to_c_func_type(ctx: CTypeContext, func_type: LLVMFunctionType):
    """Build a C function signature from an LLVM function type."""
    if func_type.is_variadic:
        raise JITException(f"Variadic function types are not supported: {func_type}")
    return ctx.to_c_func_type(func_type.inputs, func_type.output)