Use LLVM/Clang to generate code Jan 21, 2019 Basic arguments Generate IR clang -emit-llvm -S xx.cpp Generate bitcode (*.bc) clang -emit-llvm -o xx.bc xx.cpp Load pass (optimization) opt -load libxx.so -xx < xx.bc > /dev/null Load pass (with Clang) Clang ++ -Xclang -load -Xclang *.so xx.cpp