summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/dsymutil.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-11-02 20:22:03 +0000
committerHans Wennborg <hans@hanshq.net>2017-11-02 20:22:03 +0000
commitf55435ab6136aa1af0f3291d3a842bde9ec03668 (patch)
tree2df7a2e62b3e4ab1b7ce5d76e7bdee5bd271185e /llvm/tools/dsymutil/dsymutil.cpp
parent20910f46b60f8f6cf0a110199a4e8f638c43de83 (diff)
downloadbcm5719-llvm-f55435ab6136aa1af0f3291d3a842bde9ec03668.tar.gz
bcm5719-llvm-f55435ab6136aa1af0f3291d3a842bde9ec03668.zip
Fix llvm-dsymutil test in -DLLVM_ENABLE_THREADS=OFF mode
After r316999, tools/dsymutil/X86/alias.test started failing in builds that have threading disabled. llvm-svn: 317263
Diffstat (limited to 'llvm/tools/dsymutil/dsymutil.cpp')
-rw-r--r--llvm/tools/dsymutil/dsymutil.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 769668c8a9f..9d9a2418379 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -338,7 +338,6 @@ int main(int argc, char **argv) {
NumThreads = 1;
NumThreads = std::min<unsigned>(NumThreads, DebugMapPtrsOrErr->size());
- llvm::ThreadPool Threads(NumThreads);
// If there is more than one link to execute, we need to generate
// temporary files.
@@ -366,17 +365,19 @@ 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 (NumThreads == 1) {
LinkLambda();
- else
+ } else {
+ llvm::ThreadPool Threads(NumThreads);
Threads.async(LinkLambda);
+ Threads.wait();
+ }
if (NeedsTempFiles)
TempFiles.emplace_back(Map->getTriple().getArchName().str(),
OutputFile);
}
- Threads.wait();
if (NeedsTempFiles &&
!MachOUtils::generateUniversalBinary(
OpenPOWER on IntegriCloud