I wrote a few own passes for llvm, in order to use them with clang.
I integrated them in llvm (not dynamically loaded). They are even listed in the Optimizations
You can run your own pass with clang directly with -Xclang.
clang++ -Xclang -load -Xclang ./libmypass.so input.cpp
Source