Currently I'm trying to set a default Pass to Opt/Clang. It will be called implicitly when I use commands like:
clang -c -emit-llvm code.ll
and with
opt code.ll
The problem is that the modification should be done directly on the llvm source code, that is, I shouldn't use environment variables, symbolic links and aliases.
I did a lot of search on the internet and on the llvm source code but I didn't find a solution and I don't have any idea how solve this problem.
Add your pass to PassManager.
Also, have a look at these functions.