summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-06-07 17:35:19 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-06-07 17:35:19 +0000
commitbb8de35384add455cd347e533691e47531447f85 (patch)
tree6e0c03b9d09a4aa41e089514d6f21c44af4ef217
parent5482315a73ec1dd7ac3fd782d82aa9280fa26f11 (diff)
downloadbcm5719-llvm-bb8de35384add455cd347e533691e47531447f85.tar.gz
bcm5719-llvm-bb8de35384add455cd347e533691e47531447f85.zip
[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. llvm-svn: 362815
-rw-r--r--llvm/tools/dsymutil/dsymutil.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 2e835e444c2..60ba1432554 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -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);
OpenPOWER on IntegriCloud