My two main resources when learning about LLVM Passes were:
Some other helpful resources from https://llvm.org/ that I found useful:
llvm-tutor
, but still has some nice documentation and code samples.I worked on an Ubuntu 20.04 machine running in EC2. Some resources call for compiling LLVM manually - and whilst I did end up doing this for another project, this is often overkill and has a lot of pitfalls.
The standard LLVM toolchain works just fine for most LLVM Pass development purposes - just using tools likeclang
and opt
directly from an installation like:
sudo apt-get install -y llvm-13 llvm-13-dev llvm-13-tools clang-13
The next page has more details on writing LLVM Pass boilerplate code - most of the boilerplate is based off of llvm-tutor
.