[llvm-dev] Passing arguments to LLVM pass through Clang
Benno Krauss via llvm-dev
llvm-dev at lists.llvm.org
Tue Mar 17 00:48:32 PDT 2020
To pass arguments to LLVM from clang, use something like `clang source.c -mllvm -customarg -mllvm argvalue`. The -mllvm argument tells clang to forward the following argument to LLVM. Similarly, there is the -Xclang argument to pass the following argument to clang proper, as opposed to the clang driver.
Am 16.03.2020 um 23:45 schrieb Shishir V Jessu via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>:
I am adding to an LLVM pass that requires a filename as input. I am able to input this filename as a command line argument when I invoke this pass using opt, but I ultimately need to pass this argument to my code when I compile code with clang.
How can I pass this argument to clang so that I can use it in my LLVM pass? Thanks for your help!
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
More information about the llvm-dev