On a related note, the equivalent m68k was recently merged to llvm.
Next llvm release will thus have proper m68k support. AIUI only unix targets for now, but getting other ABIs implemented (AmigaOS, Atari TOS, Sinclair QL and so on) should be easy to do, relative to getting the m68k support done.
The 6502 is notoriously hostile to being a target for C compilers. The 658c16 tweaks it enough that it could theoretically have one, but so far the best one is ORCA/C.
Yeah, Forth seems a better fit. I used FIG-Forth a lot on my Apple ][ back in the day. I think it was under 8KB of code for a fairly complete environment.
Is there a good explanation somewhere of “why?” it’s notoriously hostile for C compilers, for someone like myself who is not super familiar with the 6502?
See also: Why do C to Z80 compilers produce poor code?. Z80 is slightly more powerful than 6502: it has IX and IY registers for relative addressing, but offsets are fixed and these operations are slow (compilers tend to use these registers to access stack-based variables); it has 16-bit arithmetic, but it’s limited. So mostly the same problems as for 6502.
This is a decent summary.
There was some discussion of how to support the 6502 on the LLVM list a few years ago. The suggestion was to not target the 6502 directly, but instead target SWEET16, which is a virtual ISA and emulator that Woz wrote as the target for Apple BASIC. SWEET16 has 16 16-bit registers and a full suite of 16-bit operations, implemented in about 300 bytes of 6502 assembly. It’s a lot slower to use than raw 6502 machine code, but it’s vaguely plausible as a target for something with a C-like abstract machine such as LLVM IR.