Wowza, that would be cool! IIRC Apple's clang doesn't support plugins but that can be worked around (with some/much difficulty) using clang -emit-llvm, custom opt w/ your pass, and llc to lower to assembly/object file. Of course, versioning in this kind of scenario is "fun".