Skip to content

Encoding

encoding

Helpers for encoding modules in the wasm dialect to the WebAssembly binary format.

WasmBinaryEncodingContext

A class to store the state of encoding.

Source code in xdsl/dialects/wasm/encoding.py
 9
10
11
12
class WasmBinaryEncodingContext:
    """
    A class to store the state of encoding.
    """

EncodingException

Bases: Exception

Source code in xdsl/dialects/wasm/encoding.py
15
class EncodingException(Exception): ...

WasmBinaryEncodable

Bases: ABC

Source code in xdsl/dialects/wasm/encoding.py
18
19
20
21
class WasmBinaryEncodable(abc.ABC):
    @abc.abstractmethod
    def encode(self, ctx: WasmBinaryEncodingContext, io: BinaryIO) -> None:
        raise NotImplementedError()

encode(ctx: WasmBinaryEncodingContext, io: BinaryIO) -> None abstractmethod

Source code in xdsl/dialects/wasm/encoding.py
19
20
21
@abc.abstractmethod
def encode(self, ctx: WasmBinaryEncodingContext, io: BinaryIO) -> None:
    raise NotImplementedError()