The answer depends on your goals. Why do you want to translate C # to LLVM?
VMKit was developed as the basis for creating virtual machine implementations. I believe that at some point he supported the CLR, but this support was stagnant in favor of implementing the JVM. Its goal is to create a virtual virtual machine from scratch.
Mono-llvm is a project that replaces the mono JIT backend with the rear end of LLVM. The goal is to improve the performance of JIT code on Mono.
If your goal is to use Mono, with better performance, mono-llvm is a good choice.
If you want to create an entire virtual machine from scratch, then VMKit can work.
If you just want to implement a time-consuming compiler that creates executable files without CLR dependencies, you can simply download the main LLVM libraries:
http://llvm.org/
It basically translates CIL into a textual representation of LLVM IR, and then uses the LLVM API to compile it into native machine code.
I do not know if LLVM will generate object files for you. You may need to generate them yourself, but it's pretty easy. It is basically just stuffing machine code into a data structure, creating strings, sections, and character tables, and then serializing everything to disk.
Scott Wisniewski
source share