diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-07-06 11:28:32 -0400 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2022-07-09 21:18:19 -0400 |
commit | 22a01b860b909d7836658e0c58e484950766239b (patch) | |
tree | 159e8fe000b08bf6750a8b99631556fb4d0bbade /llvm/unittests/Support/ErrorTest.cpp | |
parent | 8e19a2b43573c0245c8925d38140d76051dfbed0 (diff) | |
download | llvm-22a01b860b909d7836658e0c58e484950766239b.zip llvm-22a01b860b909d7836658e0c58e484950766239b.tar.gz llvm-22a01b860b909d7836658e0c58e484950766239b.tar.bz2 |
[LinkerWrapper] Forward `-mllvm` options to the linker wrapper
This patch adds the ability to use `-mllvm` options in the linker
wrapper when performing bitcode linking or the module compilation.
This is done by passing in the LLVM argument to the clang-linker-wrapper
tool. Inside the linker-wrapper tool we invoke the `CommandLine` parser
solely for forwarding command line options to the `clang-linker-wrapper`
to the LLVM tools that also use the `CommandLine` parser. The actual
arguments to the linker wrapper are parsed using the `Opt` library
instead.
For example, in the following command the `CommandLine` parser will attempt to
parse `abc`, while the `opt` parser takes `-mllvm <arg>` and ignores it so it is
not passed to the linker arguments.
```
clang-linker-wrapper -mllvm -abc -- <linker-args>
```
As far as I can tell this is the easiest way to forward arguments to
LLVM tool invocations. If there is a better way to pass these arguments
(such as through the LTO config) let me know.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D129424
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
0 files changed, 0 insertions, 0 deletions