[LTO API] add lto_codegen_set_module to set the destination module.
authorManman Ren <manman.ren@gmail.com>
Tue, 24 Feb 2015 00:45:56 +0000 (00:45 +0000)
committerManman Ren <manman.ren@gmail.com>
Tue, 24 Feb 2015 00:45:56 +0000 (00:45 +0000)
commitbd26e6a0065dc21fd15eec02497ceb9b962849b5
treef4d943f66ce3664bca88b1c1ae5cff25c8f7e757
parent989a0200c24eee6eedb1daa70be16a20b8af6a95
[LTO API] add lto_codegen_set_module to set the destination module.

When debugging LTO issues with ld64, we use -save-temps to save the merged
optimized bitcode file, then invoke ld64 again on the single bitcode file to
speed up debugging code generation passes and ld64 stuff after code generation.

llvm linking a single bitcode file via lto_codegen_add_module will generate a
different bitcode file from the single input. With the newly-added
lto_codegen_set_module, we can make sure the destination module is the same as
the input.

lto_codegen_set_module will transfer the ownship of the module to code
generator.

rdar://19024554

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230290 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/lto.h
include/llvm/LTO/LTOCodeGenerator.h
include/llvm/Linker/Linker.h
lib/LTO/LTOCodeGenerator.cpp
lib/Linker/LinkModules.cpp
test/LTO/X86/set-merged.ll [new file with mode: 0644]
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp
tools/lto/lto.exports