[lld/mac] Write output sections in parallel
authorMichael Eisel <michael.eisel@gmail.com>
Thu, 9 Jun 2022 00:09:48 +0000 (20:09 -0400)
committerNico Weber <thakis@chromium.org>
Thu, 9 Jun 2022 00:11:50 +0000 (20:11 -0400)
commit44978a234b8e2ad5f112d6b5910ee129bd52d54b
treea0a1dab1f8090e167a1655874bce16385d5dec9a
parentaaaf8e4c409f080f35ea227b20dc6ac8a45c2fa4
[lld/mac] Write output sections in parallel

This reduces linking time by ~8% for my project (1.19s -> 0.53s for
writeSections()). writeTo is const, which bodes well for it being
parallelizable, and I've looked through the different overridden versions and
can't see any race conditions. It produces the same byte-for-byte output for my
project.

Differential Revision: https://reviews.llvm.org/D126800
lld/MachO/Writer.cpp
lld/test/MachO/invalid/range-check.s