[PATCH] D135729: [clang][macho] Add support for -darwin-target-variant-sdk-version in cc1as

Daniel Rodríguez Troitiño via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 16:48:02 PDT 2022


drodriguez created this revision.
drodriguez added reviewers: bc-lee, MaskRay, arphaman.
Herald added a subscriber: StephenFan.
Herald added a project: All.
drodriguez requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

D121868 <https://reviews.llvm.org/D121868> provided support for -darwin-target-variant-triple, but the
support for -darwin-target-variant-sdk-version was still missing for
cc1as. These changes build upon the previous and provides such support.

- Extracted the common code to handle -darwin-target-variant-triple and -darwin-target-variant-sdk-version in the Darwin toolchain to a method that can be used for both the cc1 and the cc1as job construction. cc1as does not support some of the parameters that were provided to cc1, so the same code cannot be used for both.
- Invoke that new common code when constructing a cc1as invocation.
- Parse the new -darwin-target-variant-sdk-version in the cc1as driver. Apply its value to the MCObjectFileInfo to generate the right values in the object files.
- Includes two new tests that check that cc1as uses the provided values in -darwin-target-variant-sdk and that the Clang driver creates the jobs with the correct arguments.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135729

Files:
  clang/include/clang/Driver/ToolChain.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Clang.h
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/lib/Driver/ToolChains/Darwin.h
  clang/test/Driver/clang-cc1as-target-variant.s
  clang/test/Misc/cc1as-darwin-target-variant-sdk-version.s
  clang/tools/driver/cc1as_main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135729.466977.patch
Type: text/x-patch
Size: 11123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221011/f7eea553/attachment-0001.bin>


More information about the cfe-commits mailing list