[lld/mac] Add support for distributed ThinLTO
authorNico Weber <thakis@chromium.org>
Sun, 20 Nov 2022 16:59:16 +0000 (11:59 -0500)
committerNico Weber <thakis@chromium.org>
Fri, 13 Jan 2023 01:54:18 +0000 (20:54 -0500)
commitaa0883b59ae17e5465906dad51b5561b5292a28d
tree750199e389951468d91ceaefe795a3a58b50ecef
parentee73d240ab1dc026f99e7e9062c921928d2b138c
[lld/mac] Add support for distributed ThinLTO

Adds support for the following flags:

* --thinlto-index-only, --thinlto-index-only=
* --thinlto-emit-imports-files
* --thinlto-emit-index-files
* --thinlto-object-suffix-replace=
* --thinlto-prefix-replace=

See https://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
for some words on --thinlto-index-only.

I don't really need the other flags, but they were in the vicinity
and _someone_ might need them, so I figured I'd add them too.

`-object_path_lto` now sets `c.AlwaysEmitRegularLTOObj` as in the other ports,
which means it can now only point to a filename for non-thin LTO.
I think that was the intent of D129705 anyways, so update
test/MachO/lto-object-path.ll to use a non-thin bitcode file for that test.

Differential Revision: https://reviews.llvm.org/D138451
19 files changed:
lld/ELF/InputFiles.cpp
lld/MachO/Config.h
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/LTO.cpp
lld/MachO/LTO.h
lld/MachO/Options.td
lld/test/ELF/lto/thinlto-index-only.ll
lld/test/ELF/lto/thinlto-obj-path.ll
lld/test/ELF/lto/thinlto-prefix-replace.ll
lld/test/MachO/lto-object-path.ll
lld/test/MachO/thinlto-emit-imports.ll [new file with mode: 0644]
lld/test/MachO/thinlto-emit-index.ll [new file with mode: 0644]
lld/test/MachO/thinlto-index-file.ll [new file with mode: 0644]
lld/test/MachO/thinlto-index-only.ll [new file with mode: 0644]
lld/test/MachO/thinlto-obj-path.ll [new file with mode: 0644]
lld/test/MachO/thinlto-object-suffix-replace.ll [new file with mode: 0644]
lld/test/MachO/thinlto-prefix-replace.ll [new file with mode: 0644]