diff -ru llvm-8.0.0.src.orig/lib/LTO/LTO.cpp llvm-8.0.0.src/lib/LTO/LTO.cpp
--- llvm-8.0.0.src.orig/lib/LTO/LTO.cpp 2019-04-12 09:08:36.531911405 +0000
+++ llvm-8.0.0.src/lib/LTO/LTO.cpp 2019-04-12 09:11:23.783949538 +0000
@@ -953,7 +953,6 @@
namespace {
class InProcessThinBackend : public ThinBackendProc {
- ThreadPool BackendThreadPool;
AddStreamFn AddStream;
NativeObjectCache Cache;
std::set<GlobalValue::GUID> CfiFunctionDefs;
@@ -969,7 +968,6 @@
const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
AddStreamFn AddStream, NativeObjectCache Cache)
: ThinBackendProc(Conf, CombinedIndex, ModuleToDefinedGVSummaries),
- BackendThreadPool(ThinLTOParallelismLevel),
AddStream(std::move(AddStream)), Cache(std::move(Cache)) {
for (auto &Name : CombinedIndex.cfiFunctionDefs())
CfiFunctionDefs.insert(
@@ -1027,32 +1025,12 @@
assert(ModuleToDefinedGVSummaries.count(ModulePath));
const GVSummaryMapTy &DefinedGlobals =
ModuleToDefinedGVSummaries.find(ModulePath)->second;
- BackendThreadPool.async(
- [=](BitcodeModule BM, ModuleSummaryIndex &CombinedIndex,
- const FunctionImporter::ImportMapTy &ImportList,
- const FunctionImporter::ExportSetTy &ExportList,
- const std::map<GlobalValue::GUID, GlobalValue::LinkageTypes>
- &ResolvedODR,
- const GVSummaryMapTy &DefinedGlobals,
- MapVector<StringRef, BitcodeModule> &ModuleMap) {
- Error E = runThinLTOBackendThread(
+ return runThinLTOBackendThread(
AddStream, Cache, Task, BM, CombinedIndex, ImportList, ExportList,
ResolvedODR, DefinedGlobals, ModuleMap);
- if (E) {
- std::unique_lock<std::mutex> L(ErrMu);
- if (Err)
- Err = joinErrors(std::move(*Err), std::move(E));
- else
- Err = std::move(E);
- }
- },
- BM, std::ref(CombinedIndex), std::ref(ImportList), std::ref(ExportList),
- std::ref(ResolvedODR), std::ref(DefinedGlobals), std::ref(ModuleMap));
- return Error::success();
}
Error wait() override {
- BackendThreadPool.wait();
if (Err)
return std::move(*Err);
else