This patch adds support to llvm-lto that mirrors the support added by
r249270 to the gold plugin. This enables better testing of combined
index generation for ThinLTO.
Added a new test, and this support will be used in the test in D13515.
Note that the support directly uses lib/Object interfaces, since there
are no lib/LTO interfaces for function indexes (yet). This is similar to
gold which no longer uses lib/LTO interfaces. In order to add lto.h/.cpp
interfaces for function indexes (for linkers other than gold), is it
necessary to add lib/LTO support for function indexes, or can the lto
interfaces use lib/Object directly as gold does? Depending on the answer
to that I may want to add lib/LTO support as part of this patch and
use that in llvm-lto.
Can you put a comment a the top of the file saying what's the point of this test?