[llvm] r362815 - [dsymutil] Use the number of threads specified.
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 10:35:19 PDT 2019
Author: jdevlieghere
Date: Fri Jun 7 10:35:19 2019
New Revision: 362815
URL: http://llvm.org/viewvc/llvm-project?rev=362815&view=rev
Log:
[dsymutil] Use the number of threads specified.
Before this patch we used either a single thread, or the number of
hardware threads available, effectively ignoring the number of threads
specified on the command line.
Modified:
llvm/trunk/tools/dsymutil/dsymutil.cpp
Modified: llvm/trunk/tools/dsymutil/dsymutil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/dsymutil.cpp?rev=362815&r1=362814&r2=362815&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/dsymutil.cpp (original)
+++ llvm/trunk/tools/dsymutil/dsymutil.cpp Fri Jun 7 10:35:19 2019
@@ -367,6 +367,8 @@ static Expected<LinkOptions> getOptions(
if (NumThreads == 0)
Options.Threads = llvm::thread::hardware_concurrency();
+ else
+ Options.Threads = NumThreads;
if (DumpDebugMap || Verbose)
Options.Threads = 1;
@@ -526,9 +528,9 @@ int main(int argc, char **argv) {
// Shared a single binary holder for all the link steps.
BinaryHolder BinHolder;
- NumThreads =
+ unsigned ThreadCount =
std::min<unsigned>(OptionsOrErr->Threads, DebugMapPtrsOrErr->size());
- llvm::ThreadPool Threads(NumThreads);
+ llvm::ThreadPool Threads(ThreadCount);
// If there is more than one link to execute, we need to generate
// temporary files.
@@ -600,7 +602,7 @@ int main(int argc, char **argv) {
// FIXME: The DwarfLinker can have some very deep recursion that can max
// out the (significantly smaller) stack when using threads. We don't
// want this limitation when we only have a single thread.
- if (NumThreads == 1)
+ if (ThreadCount == 1)
LinkLambda(OS);
else
Threads.async(LinkLambda, OS);
More information about the llvm-commits
mailing list