Hello,
I have written a pass for the IR and I can run it with opt -load lib/LLVMMyPass.so -mypass -myarguments -S -o output.ll < output.bc
I have registered my pass with the following code:
static RegisterPass
X(“mypass”, “MyPass Pass (with getAnalysisUsage implemented)”);
How do I include the same pass in the clang driver. I tried running the pass:
clang output.c -o output -Xclang -load -Xclang lib/LLVMMyPass.so -mypass -myarguments
However, the pass is not being run as I cannot see output from my pass. What is the standard way to do it?
I have also tried approach described here: https://www.cs.cornell.edu/~asampson/blog/clangpass.html . It didn’t work.