[all-commits] [llvm/llvm-project] d2ead9: [LinkerWrapper][NFC] Rework command line argument ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Jul 8 08:18:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d2ead9e324d4d268e8c0634849d6081e177c9dd7
      https://github.com/llvm/llvm-project/commit/d2ead9e324d4d268e8c0634849d6081e177c9dd7
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-07-08 (Fri, 08 Jul 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/linker-wrapper-image.c
    M clang/test/Driver/linker-wrapper.c
    M clang/test/Driver/openmp-offload.c
    M clang/tools/clang-linker-wrapper/CMakeLists.txt
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    A clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

  Log Message:
  -----------
  [LinkerWrapper][NFC] Rework command line argument handling in the linker wrapper

Summary:
This patch reworks the command line argument handling in the linker
wrapper from using the LLVM `cl` interface to using the `Option`
interface with TableGen. This has several benefits compared to the old
method.

We use arguments from the linker arguments in the linker
wrapper, such as the libraries and input files, this allows us to
properly parse these. Additionally we can now easily set up aliases to
the linker wrapper arguments and pass them in the linker input directly.
That is, pass an option like `cuda-path=` as `--offload-arg=cuda-path=`
in the linker's inputs. This will allow us to handle offloading
compilation in the linker itself some day. Finally, this is also a much
cleaner interface for passing arguments to the individual device linking
jobs.


  Commit: e0de264f6355c397e91927827a9cbb940c903607
      https://github.com/llvm/llvm-project/commit/e0de264f6355c397e91927827a9cbb940c903607
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-07-08 (Fri, 08 Jul 2022)

  Changed paths:
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

  Log Message:
  -----------
  [LinkerWrapper][NFC] Move error handling to a common function

Summary:
This patch merges all the error handling functions to a single function
call so we don't define the same lambda many times.


Compare: https://github.com/llvm/llvm-project/compare/29c6bf45c37a...e0de264f6355


More information about the All-commits mailing list