[ThinLTO] add post-thinlto-merge option to -lto-embed-bitcode
authorMircea Trofin <mtrofin@google.com>
Mon, 14 Sep 2020 17:45:00 +0000 (10:45 -0700)
committerMircea Trofin <mtrofin@google.com>
Tue, 15 Sep 2020 22:56:11 +0000 (15:56 -0700)
commit61fc10d6a520f267e11009ce8fce88d73615796b
tree0de41e888ded036b80b693c73f37de094331344d
parentae726fecae9a1cc9c50de5a9f6e860056f82c556
[ThinLTO] add post-thinlto-merge option to -lto-embed-bitcode

This will embed bitcode after (Thin)LTO merge, but before optimizations.
In the case the thinlto backend is called from clang, the .llvmcmd
section is also produced. Doing so in the case where the caller is the
linker doesn't yet have a motivation, and would require plumbing through
command line args.

Differential Revision: https://reviews.llvm.org/D87636
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/Inputs/start-lib1.ll [new file with mode: 0644]
clang/test/CodeGen/Inputs/start-lib2.ll [new file with mode: 0644]
clang/test/CodeGen/thinlto_embed_bitcode.ll [new file with mode: 0644]
llvm/include/llvm/LTO/LTOBackend.h
llvm/lib/LTO/LTOBackend.cpp
llvm/test/LTO/X86/Inputs/start-lib1.ll
llvm/test/LTO/X86/embed-bitcode.ll