[dsymutil] Reuse a single thread pool across architectures (#204691)
dsymutil links the architectures of a universal binary on a thread pool,
and the parallel linker's DWARFLinkerImpl::link() then created a second
pool to link each architecture's object files. With one such inner pool
per architecture, dsymutil spun up more worker threads than the machine
has cores.
Add DWARFLinkerBase::setThreadPool() so the caller provides the pool.
The parallel linker schedules the object files on it as a
ThreadPoolTaskGroup. dsymutil hands over the pool it already uses to
schedule the architectures, llvm-dwarfutil passes one sized by
--num-threads, and the classic linker ignores it and manages its own
threads (always 2 for the lockstep algorithm).
The per-compile-unit cloning still runs on the global llvm::parallel
executor, whose per-thread allocators are indexed by getThreadIndex(),
so it can't move onto this pool.