How does Inkwell, like, work? #548
Replies: 1 comment
-
https://releases.llvm.org/18.1.0/docs/tutorial/index.html Here's LLVM's official C++ version of their Kaleidoscope tutorial (for version 18, which Inkwell supports). Chapters 1 and 2 cover lexing and parsing, and the builder/LLVM come into play starting in Chapter 3. Looking at that will probably help you understand. I'd also say that, generally, your lexing and parsing can happen however you want it to. As long as your parser provides you with some sort of data representation of the program's structure, you can then figure out how to build the LLVM IR off of it. I don't know about Inkwell's version of the example, but the official C++ version also specifically avoids focusing on good lexing or parsing in order to get to the LLVM stuff faster, so I'd avoid using that to understand those steps. |
Beta Was this translation helpful? Give feedback.
-
I'm new to LLVM and I'm struggling to follow the code examples. Do the Builder functions set things for the Execution Engine to use under the hood? What are the requirements for the Tokens generated by the Parser? Where does the Vec of Tokens go to get compiled? It's not that clear from the code how these things affect each other. Is there documentation of the LLVM C API that explains this?
Beta Was this translation helpful? Give feedback.
All reactions