diff options
author | Florian Hahn <flo@fhahn.com> | 2021-01-29 10:20:54 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2021-01-29 11:53:11 +0000 |
commit | f3a710cade9381030f3e1e9778c5fc12f8a02fdf (patch) | |
tree | 1e311dad76e7a14fdd60a016d3267106ed4ddcd6 /llvm/lib/LTO/LTO.cpp | |
parent | 64ced3ce89a6dd429136d0ad7832853d8b3fdef0 (diff) | |
download | llvm-f3a710cade9381030f3e1e9778c5fc12f8a02fdf.zip llvm-f3a710cade9381030f3e1e9778c5fc12f8a02fdf.tar.gz llvm-f3a710cade9381030f3e1e9778c5fc12f8a02fdf.tar.bz2 |
[LTO] Update splitCodeGen to take a reference to the module. (NFC)
splitCodeGen does not need to take ownership of the module, as it
currently clones the original module for each split operation.
There is an ~4 year old fixme to change that, but until this is
addressed, the function can just take a reference to the module.
This makes the transition of LTOCodeGenerator to use LTOBackend a bit
easier, because under some circumstances, LTOCodeGenerator needs to
write the original module back after codegen.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D95222
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index f1b112a..375d205 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1101,9 +1101,9 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) { } if (!RegularLTO.EmptyCombinedModule || Conf.AlwaysEmitRegularLTOObj) { - if (Error Err = backend( - Conf, AddStream, RegularLTO.ParallelCodeGenParallelismLevel, - std::move(RegularLTO.CombinedModule), ThinLTO.CombinedIndex)) + if (Error Err = + backend(Conf, AddStream, RegularLTO.ParallelCodeGenParallelismLevel, + *RegularLTO.CombinedModule, ThinLTO.CombinedIndex)) return Err; } |