LLVM中是否存在传递或某些内容,它会将给定的llvm::Module
序列化为二进制形式,然后将此数据放入源模块中?因此,当我将其链接到二进制文件时,我最终将编译代码的bitcode表示与单个文件中的本机代码链接?
如果没有,你能就如何实现这个提出一些建议吗?
答案 0 :(得分:2)
This functionality is partially implemented in Clang/LLVM now and is called ThinLTO. It is now possible to run clang -c -emit-llvm -flto=thin source.cpp
and this would produce a LLVM bitcode file with same bitcode embedded in it. Support for writing native object file with embedded bitcode is being worked on.