Skip to content

Convert

convert

convert_module(module: ModuleOp) -> ir.Module

Convert an xDSL module to an LLVM module.

Source code in xdsl/backend/llvm/convert.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def convert_module(module: ModuleOp) -> ir.Module:
    """
    Convert an xDSL module to an LLVM module.
    """
    llvm_module = ir.Module()

    for op in module.ops:
        match op:
            case llvm.FuncOp():
                _convert_func(op, llvm_module)
            case _:
                raise NotImplementedError(
                    f"Conversion not implemented for op: {op.name}"
                )

    return llvm_module