Support: Support LLVM_ENABLE_THREADS=0 in llvm/Support/thread.h.
Specifically, the header now provides llvm::thread, which is either a
typedef of std::thread or a replacement that calls the function synchronously
depending on the value of LLVM_ENABLE_THREADS.
llvm-svn: 246402
diff --git a/llvm/lib/CodeGen/ParallelCG.cpp b/llvm/lib/CodeGen/ParallelCG.cpp
index 3e6a71d..748d388 100644
--- a/llvm/lib/CodeGen/ParallelCG.cpp
+++ b/llvm/lib/CodeGen/ParallelCG.cpp
@@ -56,7 +56,7 @@
return M;
}
- std::vector<std::thread> Threads;
+ std::vector<thread> Threads;
SplitModule(std::move(M), OSs.size(), [&](std::unique_ptr<Module> MPart) {
// We want to clone the module in a new context to multi-thread the codegen.
// We do it by serializing partition modules to bitcode (while still on the
@@ -88,7 +88,7 @@
std::move(BC));
});
- for (std::thread &T : Threads)
+ for (thread &T : Threads)
T.join();
return {};