aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp b/contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp
index 849b667254bd..3e32afaafa6e 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/ParallelCG.cpp
@@ -36,8 +36,8 @@ static void codegen(Module *M, llvm::raw_pwrite_stream &OS,
CodeGenPasses.run(*M);
}
-std::unique_ptr<Module> llvm::splitCodeGen(
- std::unique_ptr<Module> M, ArrayRef<llvm::raw_pwrite_stream *> OSs,
+void llvm::splitCodeGen(
+ Module &M, ArrayRef<llvm::raw_pwrite_stream *> OSs,
ArrayRef<llvm::raw_pwrite_stream *> BCOSs,
const std::function<std::unique_ptr<TargetMachine>()> &TMFactory,
CodeGenFileType FileType, bool PreserveLocals) {
@@ -45,9 +45,9 @@ std::unique_ptr<Module> llvm::splitCodeGen(
if (OSs.size() == 1) {
if (!BCOSs.empty())
- WriteBitcodeToFile(*M, *BCOSs[0]);
- codegen(M.get(), *OSs[0], TMFactory, FileType);
- return M;
+ WriteBitcodeToFile(M, *BCOSs[0]);
+ codegen(&M, *OSs[0], TMFactory, FileType);
+ return;
}
// Create ThreadPool in nested scope so that threads will be joined
@@ -57,7 +57,7 @@ std::unique_ptr<Module> llvm::splitCodeGen(
int ThreadCount = 0;
SplitModule(
- std::move(M), OSs.size(),
+ 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
@@ -95,6 +95,4 @@ std::unique_ptr<Module> llvm::splitCodeGen(
},
PreserveLocals);
}
-
- return {};
}