[lld-macho] Add LTO cache support
authorLeonard Grey <lgrey@chromium.org>
Thu, 15 Jul 2021 16:56:13 +0000 (12:56 -0400)
committerNico Weber <thakis@chromium.org>
Thu, 15 Jul 2021 16:56:13 +0000 (12:56 -0400)
commitc931ff72bde42846db4530893a94c044879c5ae9
treeffd0b0fd927fa5201ee265d29c02362be153b731
parentc46d99e4ba16c76e666eb46dce710036ecbcee0d
[lld-macho] Add LTO cache support

This adds support for the lld-only `--thinlto-cache-policy` option, as well as
implementations for ld64's `-cache_path_lto`, `-prune_interval_lto`,
`-prune_after_lto`, and `-max_relative_cache_size_lto`.

Test is adapted from lld/test/ELF/lto/cache.ll

Differential Revision: https://reviews.llvm.org/D105922
lld/MachO/Config.h
lld/MachO/Driver.cpp
lld/MachO/LTO.cpp
lld/MachO/LTO.h
lld/MachO/Options.td
lld/test/MachO/lto-cache.ll [new file with mode: 0644]