This is my work while following along with LLVM tutorials that can be found here: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html. The tutorial covers three different three different sub-projects. I have included each in this repository under their own directory.
This project gives an example for how we can use our toy langauge to generate an object file that can be linked into a cpp file. By running bash b
:
- The clang compiler is used to transform kaleidoscope.cpp into an output kaleidoscope compiler
- Then, we use the kaleidoscope compiler to convert the average.ks file into an object file output.o
- Next, we use the clang compiler again to link output.o into a cpp file and generate an executable main
- Lastly, we execute the main file and see successful use of our average function defined in average.ks
This project leverages a jit compiler to create a command line / prompt interface for the toy language. By running bash b
:
- The clang compiler is used to transform kaleidoscope.cpp into a kaleidoscope executable
- Running the kaliedoscope executable pulls us into the prompt interface to interact with the language
- I have included a tests.txt file that you can copy and paste into the prompt to generate several different mandelbrot sets
- crtl+d to exit the prompt interface
This project shows how llvm can also be used to generate debug information. By running bash b
:
- The clang compiler is used to transform kaleidoscope.cpp into a kaleidoscope debugger
- Then, we pass the fib.ks file into the kaleidoscope debugger which emits thorough information regarding our .ks file
This project shows how llvm can be integrated with mlir based on the official mlir toy tutorial.