@@ -344,6 +344,59 @@ The implemented type checker follows the rules above and should it find that the
The borrow checker should check whether the variable is a mutable or unmutable borrow. If it's unmutable the program should not be able to change the value that the variable holds. If it's mutable the borrow checker should check that the mutable borrow does not occur somewhere else, so that the variable can't be written to at the same time.
## LLVM
Very basic code generation was implemented, the compiler does not support all things in the SOS. Most of the LLVM code was inspired by Per's example, the Inkwell Kaleidoscope example as well as Gustav Hansson's work (https://github.com/97gushan/D7050E).
Phi nodes have been added when compiling if branches. So that the compiler can understand which values to use after the branch. IR code can be seen below
I have improved my knowledge in Rust. As well as gained a basic understanding on how the Rust features such as borrows and type checks works. I've learnt how to create my own parser and then how to interpret an AST.