Open stlamoureux1 opened 2 months ago
Updated:
Issue 1: I can't get a build to work on my Linux machine. I'll see if I can use binaries instead and let you know.
Thought: Still figuring it out, but I'm assuming it's necessary to write a translation scheme from AST to LLVM IR manually. It looks like that IR is quite complex in itself so I'm wondering how much we gain compared to translating to asm or to C.
One alternative that might be more lightweight: https://asmjit.com
Resources:
A quick overview tutorial for LLVM IR: -- https://mcyoung.xyz/2023/08/01/llvm-ir/
Youtube playlist going over generating LLVM IR: -- https://www.youtube.com/watch?v=Lvc8qx8ukOI&list=PLGNbPb3dQJ_5Dv45KhMlt9HMSlnfMyb2V&pp=iAQB -- This guy's channel also has playlists for trasnpilers, type checkers, etc. I'll be trying to get through as much as I can.
Book on mapping high-level constructs to IR, focused on C/C++: -- https://mapping-high-level-constructs-to-llvm-ir.readthedocs.io/en/latest/index.html
Also if you want to get a feel for it I would recommend writing some C code and compiling it with:
$ clang -S -emit-llvm -o [name].ll [name].c
and you can view the IR that way.
Gonna drop this here as well:
https://github.com/PacktPublishing/Learn-LLVM-17/tree/main/Chapter02/calc/src
Comes from a book on LLVM 17 from O'Reilly. I'm able to get online access to the book with my public library account you might wanna try similar. Shows how the visitor pattern is used is for getting IR from ASTs, so I'm gonna be going through that and trying to internalize it.
Share insights, resources, and issues for using LLVM.