This is an archive of the discontinued LLVM Phabricator instance.

LTO: Simplify merged module ownership.
ClosedPublic

Authored by pcc on Aug 20 2015, 11:59 AM.

Details

Summary

This change moves LTOCodeGenerator's ownership of the merged module to a
field of type std::unique_ptr<Module>. This helps simplify parts of the code
and clears the way for the module to be consumed by LLVM CodeGen (see D12132
review comments).

This changes the C API semantics (lto_codegen_set_module now destroys its
argument) so I have incremented the API version.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 32721.Aug 20 2015, 11:59 AM
pcc retitled this revision from to LTO: Simplify merged module ownership..
pcc updated this object.
pcc added reviewers: mehdi_amini, dexonsmith.
pcc added a subscriber: llvm-commits.
pcc updated this revision to Diff 32859.Aug 21 2015, 1:27 PM
  • Restore and deprecate the old lto_codegen_set_module() behaviour until Apple can fix their linker
  • Do not destroy the merged module after code generation
  • clang-format
pcc updated this revision to Diff 32888.Aug 21 2015, 5:15 PM
  • Restore ownership semantics for lto_codegen_set_module
  • Remove all remaining references to module via IRLinker
pcc updated this revision to Diff 32998.Aug 24 2015, 2:32 PM

Rename OwnedModule to MergedModule; split out mechanical changes to r245874

This revision was automatically updated to reflect the committed changes.