[PATCH] D41274: [LTO] NFC: remove unique_ptr from some LTO::RegularLTOState members

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 00:06:57 PST 2017


mehdi_amini added a comment.

This patch doesn't seem motivated, the only effect I can see is that a ThinLTO link that don't include any LTO module would create a module while it was lazily created only if needed before.



================
Comment at: llvm/include/llvm/Transforms/Utils/SplitModule.h:39
     function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback,
     bool PreserveLocals = false);
 
----------------
You're changing the semantic here by not transferring ownership of the module. 
This is not a const reference, which indicate side-effects on the module, but you don't document what are these.


https://reviews.llvm.org/D41274





More information about the llvm-commits mailing list