DoxigAlpha

CompilerBackend

This enum is set by the compiler and communicates which compiler backend is used to produce machine code. Think carefully before deciding to observe this value. Nearly all code should be agnostic to the backend that implements the language. The use case to use this value is to work around problems with compiler implementations.

Avoid failing the compilation if the compiler backend does not match a whitelist of backends; rather one should detect that a known problem would occur in a blacklist of backends.

The enum is nonexhaustive so that alternate Zig language implementations may choose a number as their tag (please use a random number generator rather than a "cute" number) and codebases can interact with these values even if this upstream enum does not have a name for the number. Of course, upstream is happy to accept pull requests to add Zig implementations to this enum.

This data structure is part of the Zig language specification.

Fields of this type

Fields

#
other:other
It is allowed for a compiler implementation to not reveal its identity,
stage1:stage1
The original Zig compiler created in 2015 by Andrew Kelley.
stage2_llvm:stage2_llvm
The reference implementation self-hosted compiler of Zig, using the
stage2_c:stage2_c
The reference implementation self-hosted compiler of Zig, using the
stage2_wasm:stage2_wasm
The reference implementation self-hosted compiler of Zig, using the
stage2_arm:stage2_arm
The reference implementation self-hosted compiler of Zig, using the
stage2_x86_64:stage2_x86_64
The reference implementation self-hosted compiler of Zig, using the
stage2_aarch64:stage2_aarch64
The reference implementation self-hosted compiler of Zig, using the
stage2_x86:stage2_x86
The reference implementation self-hosted compiler of Zig, using the
stage2_riscv64:stage2_riscv64
The reference implementation self-hosted compiler of Zig, using the
stage2_sparc64:stage2_sparc64
The reference implementation self-hosted compiler of Zig, using the
stage2_spirv:stage2_spirv
The reference implementation self-hosted compiler of Zig, using the
stage2_powerpc:stage2_powerpc
The reference implementation self-hosted compiler of Zig, using the
_:_