dymokomi/luce-base
Source of release 0.46.0
0.46.0 / src / back / README.md
# Backends
`backend.lucb` connects the checked program to the selected backend. Native is the default.
| Location | Responsibility |
| --- | --- |
| `ir/` | Native intermediate representation, textual dumps, control-flow graph and lowering from the checked tree |
| `opt/` | Inlining, local optimization, SSA construction, value numbering, load elimination and de-SSA |
| `native/` | ARM64 and x86-64 assembly, register allocation, frame layout and DWARF emission |
| `native/x86_64/` | x86 calling-convention, object-format and unwind policy, separate from instruction selection |
| `assemble/` | The x86-64 assembler: AT&T assembly to a COFF object, in the compiler (`x86_64/` encodes instructions; `object` and `coff` are what a linker reads) |
| `link/` | The Windows linker: COFF objects to a PE executable, in the compiler; imports from the DLLs' own export tables, a start library in place of MinGW's start files, and `--lib`'s archive |
| `c/` | Explicit C comparison/snapshot emission and C library headers |
| `names.lucb` | Symbol naming shared by both backends |
| `target.lucb` | Target platform and toolchain definitions |
| `isa.lucb` | Instruction-set capabilities and inline-assembly register definitions |
C headers in `c/header.lucb` also describe native library exports; generating a header does not select C code generation.
The native pipeline is checked tree → `ir/lower` → `opt/` → `native/` → assembly.
Imports retain the module's leaf name, for example `import back.ir.ir` uses `ir.Unit`.