Skip to content

X86 set arch

x86_set_arch

Record the x86 target on the module.

Passes downstream read it from there rather than each taking their own arch option, in the same spirit as an LLVM module carrying its target triple.

X86SetArch dataclass

Bases: ModulePass

Sets the x86.arch attribute on the module.

Source code in xdsl/transforms/x86_set_arch.py
16
17
18
19
20
21
22
23
24
25
26
27
@dataclass(frozen=True)
class X86SetArch(ModulePass):
    """
    Sets the `x86.arch` attribute on the module.
    """

    name = "x86-set-arch"

    arch: str

    def apply(self, ctx: Context, op: ModuleOp) -> None:
        X86Arch.arch_for_name(self.arch).set_on_module(op)

name = 'x86-set-arch' class-attribute instance-attribute

arch: str instance-attribute

__init__(arch: str) -> None

apply(ctx: Context, op: ModuleOp) -> None

Source code in xdsl/transforms/x86_set_arch.py
26
27
def apply(self, ctx: Context, op: ModuleOp) -> None:
    X86Arch.arch_for_name(self.arch).set_on_module(op)