Page MenuHomePhabricator

[ThinLTO] ThinLTO object file interfaces

Authored by tejohnson on Aug 3 2015, 8:29 AM.



This patch adds the ThinLTOObjectFile class which has interfaces for reading and writing ThinLTO blocks in bitcode files. As discussed in the File API and Data Structures RFC (see below for link), the ThinLTO information is read in different compiler/linker invocations than the rest of the Module IR, which is why the ThinLTO information uses a different ObjectFile subclass and a data structure outside of the Module class. See the RFC for more details.

The ThinLTO function index/summary data structures are defined in, and the bitcode reading/writing support is defined in

Related RFCs:
RFC: ThinLTO File Format (
RFC: ThinLTO File API and Data Structures (

Diff Detail

Event Timeline

tejohnson updated this revision to Diff 31235.Aug 3 2015, 8:29 AM
tejohnson retitled this revision from to [ThinLTO] ThinLTO object file interfaces.
tejohnson updated this object.

Pinging since the first one didn't get sent to llvm-commits (I added the subscriber after uploading, which apparently doesn't work well).

tejohnson updated this object.Aug 12 2015, 2:36 PM
tejohnson updated this revision to Diff 32046.Aug 13 2015, 6:50 AM
tejohnson updated this object.

Updated to remove native wrapper support (as I did yesterday with the bitcode reading/writing patch, as per discussion in RFC thread on the ThinLTO File Format.

tejohnson updated this revision to Diff 32377.Aug 17 2015, 9:38 PM

I added changes to the gold-plugin.cpp to use the interfaces here and in related patches D11721 and D11722 to implement ThinLTO phase-2 compilation which checks if the linked files contain ThinLTO information, and if so simply builds and writes the combined index file and exits.

Also removed an interface that wasn't necessary for writing the combined index..

tejohnson updated this revision to Diff 32487.Aug 18 2015, 5:57 PM

Update function name per new D11722 patch.