Does anyone know any example of an open source LLVM backend for a stack based machine? I need this for education purposes.
The JVM is a stack-based virtual machine. VMKit was an open-source project of LLVM which implemented a JVM with a LLVM backend. The idea of VMKit was to create a toolkit for building virtual machines (or managed runtime environments) such as JVM, CLI/CLR, R's runtime etc. To find out more, see Nicolas Geoffray's PhD thesis. While the project is retired, the source code is still available.
Also, Microsoft have released llilc which is a LLVM JIT compiler for IL/MSIL/CIL (which could be argued is a stack machine). The JIT code can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With