Some simple LLVM Pass examples:
llvm-project/llvm
├── ...
├── lib
│ └── Transforms
│ │── 1.MyPass
│ │── 2.SimpleModulePass
│ └── 3.SimpleFunctionPass
│ └── 4.SimpleLoopPass
│ └── 5.CompileTimeFunctionCallCounter
│ └── 6.RunTimeFunctionCallCounter
│ └── 7.ConstantAdditionCombiner
│── ...
具体编译及使用步骤,请参考: