Tutorial by Examples

It is always recommend to go to the LLVM official website and follow the installation guides depending on your OS. If you are working on posix then in short you have to add one of the official LLVM package repositories. For example if you work on Ubuntu Xenial (16.04) you add a deb and deb-src entr...
So what we will try to do is to compile a following function int sum(int a, int b) { return a + b + 2; } on the fly. And here's the entire .cpp example: #include <iostream> #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/I...

Page 1 of 1