Is there a way to write an LLVM front end compiler in C#?
LLVM is written in C++ and is designed for compile-time, link-time, run-time, and "idle-time" optimization.
C-like languages use the Clang front end. This component compiles C, C++, Objective C, and Objective C++ code into LLVM bitcode – and from there into object files, using LLVM.
The llvm-gcc command is the LLVM C front end. It is a modified version of gcc that compiles C/ObjC programs into native objects, LLVM bitcode or LLVM assembly language, depending upon the options. By default, llvm-gcc compiles to native objects just like GCC does.
If you are looking for source analysis or source-to-source transformation tools, Clang is probably a great solution for you. Clang supports C++11, C++14 and C++17, please see the C++ status page for more information.
I don't see why not. There is a language reference for LLVM and as long as you are compliant with the language, there is no reason you can't write something in C# which will parse that language and either:
This isn't to say it will be easy, but it can be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With