OSDN Git Service

[ThinLTO]LTO]Legacy] Fix dependent libraries support by adding querying of the IRSymtab
authorBen Dunbobbin <bd1976llvm@gmail.com>
Wed, 12 Jun 2019 11:07:56 +0000 (11:07 +0000)
committerBen Dunbobbin <bd1976llvm@gmail.com>
Wed, 12 Jun 2019 11:07:56 +0000 (11:07 +0000)
commitc543215de3b2758c93fa625256834112084b76a5
tree0372d96c13ec11d112ec78a856c6fd0402205737
parent12f795f296aafcb48c39205cac938ae2d755ce8e
[ThinLTO]LTO]Legacy] Fix dependent libraries support by adding querying of the IRSymtab

Dependent libraries support for the legacy api was committed in a
broken state (see: https://reviews.llvm.org/D60274). This was missed
due to the painful nature of having to integrate the changes into a
linker in order to test. This change implements support for dependent
libraries in the legacy LTO api:

- I have removed the current api function, which returns a single
string, and   added functions to access each dependent library
specifier individually.

- To reduce the testing pain, I have made the api functions as thin as
possible to   maximize coverage from llvm-lto.

- When doing ThinLTO the system linker will load the modules lazily
when scanning   the input files. Unfortunately, when modules are
lazily loaded there is no access   to module level named metadata. To
fix this I have added api functions that allow   querying the IRSymtab
for the dependent libraries. I hope to expand the api in the   future
so that, eventually, all the information needed by a client linker
during   scan can be retrieved from the IRSymtab.

Differential Revision: https://reviews.llvm.org/D62935

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363140 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/lto.h
include/llvm/LTO/legacy/LTOModule.h
lib/LTO/LTOModule.cpp
test/LTO/X86/Inputs/list-dependent-libraries.ll [new file with mode: 0644]
test/LTO/X86/list-dependent-libraries.ll [new file with mode: 0644]
test/tools/llvm-lto/error.ll
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp
tools/lto/lto.exports