There already seems to be a 6502 backend for LLVM specifically geared for c64:
https://github.com/c64scene-ar/llvm-6502
Which means you can just use the clang frontend and even write C++17 code which compiles down to 6502 ML.
https://github.com/c64scene-ar/llvm-6502
Which means you can just use the clang frontend and even write C++17 code which compiles down to 6502 ML.
cc65 seems to be the only viable one around last I looked. And it doesn't support the 65816, only the 6502. WDC offers their own compiler, but it's not fully open/free.