Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When you have an LLVM frontend, what you generally do is have your driver run the optimization and code generation steps itself using the LLVM APIs rather than using opt/llc binaries to drive this step. That way, you don't need the LLVM binaries, just the libraries that you statically link into your executable.

For example, all of the code in clang to do this is located in https://github.com/llvm/llvm-project/blob/main/clang/lib/Cod...



What if my frontend is written in non cpp? e.g haskell, js, java, c#, etc.


You use the LLVM-C bindings via your favorite FFI mechanism to generate the code then, usually.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: