I know how to invoke a new pass by opt, but when I’m trying to use clang to load and run a new function pass, the pass can’t be executed, the pass is just like the hello pass in llvm/lib/Transforms/Hello created. the command line i used in below, how can i invoke my new pass
…/llvm-project-llvmorg-15.0.7/build/bin/clang -Xclang -load -Xclang …/llvm-project-llvmorg-15.0.7/build/lib/LLVMHello.so -O1 test.c -o test
But clang-14.0.0 with new PM, it has the same problem with clang-15, I also tried the way you suggested, also failed. Maybe there are some problems with myself, but fortunately, I have found a feasible method so far.
Thank you again for your reply.
The -fpass-plugin=... I suggested was only for new PassManager Pass plugins. That flag can not be used to load Pass plugins for legacy PassManager. (In case you don’t know plugins for new / legacy Passes are completely different)