[ThinLTO/LTO] Don't link in unneeded metadata
authorTeresa Johnson <tejohnson@google.com>
Fri, 18 Dec 2015 17:51:37 +0000 (17:51 +0000)
committerTeresa Johnson <tejohnson@google.com>
Fri, 18 Dec 2015 17:51:37 +0000 (17:51 +0000)
commite8df234a6ea0dbc20e4da677f2f9f8c426f44246
tree7185d9f9615e2ff9d7764d40942512dd1325a40a
parentec08d99feee1ebbc5176d01e1c6cb021ade1eb37
[ThinLTO/LTO] Don't link in unneeded metadata

Summary:
Third patch split out from http://reviews.llvm.org/D14752.

Only map in needed DISubroutine metadata (imported or otherwise linked
in functions and other DISubroutine referenced by inlined instructions).
This is supported for ThinLTO, LTO and llvm-link --only-needed, with
associated tests for each one.

Depends on D14838.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D14843

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256003 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/ValueMapper.h
lib/Linker/IRMover.cpp
lib/Transforms/Utils/ValueMapper.cpp
test/Linker/Inputs/only-needed-debug-metadata.ll [new file with mode: 0644]
test/Linker/only-needed-debug-metadata.ll [new file with mode: 0644]
test/Linker/thinlto_funcimport_debug.ll
test/tools/gold/X86/Inputs/linkonce-weak.ll
test/tools/gold/X86/linkonce-weak.ll