[ThinLTO] Metadata linking for imported functions
authorTeresa Johnson <tejohnson@google.com>
Thu, 17 Dec 2015 17:14:09 +0000 (17:14 +0000)
committerTeresa Johnson <tejohnson@google.com>
Thu, 17 Dec 2015 17:14:09 +0000 (17:14 +0000)
commite5a619173274bf2a9033ea1c8b2346f1bee2766b
treedf1a23654ddaef760e878af89977d13945649896
parentcaaa3aa07c8fa129c8032597f2d0317637a1569a
[ThinLTO] Metadata linking for imported functions

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

Maps metadata as a post-pass from each module when importing complete,
suturing up final metadata to the temporary metadata left on the
imported instructions.

This entails saving the mapping from bitcode value id to temporary
metadata in the importing pass, and from bitcode value id to final
metadata during the metadata linking postpass.

Depends on D14825.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 255909
18 files changed:
llvm/include/llvm/IR/GVMaterializer.h
llvm/include/llvm/IR/Metadata.h
llvm/include/llvm/IRReader/IRReader.h
llvm/include/llvm/Linker/IRMover.h
llvm/include/llvm/Linker/Linker.h
llvm/include/llvm/Transforms/Utils/ValueMapper.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/IR/Metadata.cpp
llvm/lib/IRReader/IRReader.cpp
llvm/lib/Linker/IRMover.cpp
llvm/lib/Linker/LinkModules.cpp
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/lib/Transforms/Utils/ValueMapper.cpp
llvm/test/Linker/Inputs/thinlto_funcimport_debug.ll [new file with mode: 0644]
llvm/test/Linker/thinlto_funcimport_debug.ll [new file with mode: 0644]
llvm/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll [new file with mode: 0644]
llvm/test/Transforms/FunctionImport/funcimport_debug.ll [new file with mode: 0644]
llvm/tools/llvm-link/llvm-link.cpp