[LTO API] split lto_codegen_compile to lto_codegen_optimize and
authorManman Ren <manman.ren@gmail.com>
Tue, 3 Feb 2015 18:39:15 +0000 (18:39 +0000)
committerManman Ren <manman.ren@gmail.com>
Tue, 3 Feb 2015 18:39:15 +0000 (18:39 +0000)
commit69e4dd1b12f6f880b1d853805d03a04a490be5f5
tree7618583a472f83cbedf2155a8da2025f7e20454c
parent42a7bc535e49af28dfa58807e8632833dcd5d01e
[LTO API] split lto_codegen_compile to lto_codegen_optimize and
lto_codegen_compile_optimized. Also add lto_api_version.

Before this commit, we can only dump the optimized bitcode after running
lto_codegen_compile, but it includes some impacts of running codegen passes,
one example is StackProtector pass. We will get assertion failure when running
llc on the optimized bitcode, because StackProtector is effectively run twice.

After splitting lto_codegen_compile, the linker can choose to dump the bitcode
before running lto_codegen_compile_optimized.

lto_api_version is added so ld64 can check for runtime-availability of the new
API.

rdar://19565500

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228000 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/lto.h
include/llvm/LTO/LTOCodeGenerator.h
lib/LTO/LTOCodeGenerator.cpp
tools/lto/lto.cpp
tools/lto/lto.exports