/llvm-pass-plugin-playground

Ready-to-use LLVM pass plugin development environment

Primary LanguageCMake

LLVM Pass Plugin Playground

Ready-to-use environment that makes LLVM pass plugin development easy, inspired by llvm-tutor.

How to use

  • Add new plugins to lib and modify CMakeFiles.txt accordingly.

  • Add your pass to the compiler wrapper by modifying passes;

  • To build plugins, run cmake-config.sh first, then cd build && make.

  • To use different LLVM versions, set the env var LLVM_CONFIG before you run cmake-config.sh, e.g., LLVM_CONFIG=llvm-config-15 ./cmake-config.sh if you want to use LLVM-15/clang-15. By default, llvm-config is used.

  • Use the provided compiler wrappers (build/compiler/custom-clang and build/compiler/custom-clang++) to compile your programs. The wrappers will automatically load your passes.