This article discusses how object files can contain LLVM IR that is used for link-time optimization. But what if the linker is compiling a project that includes a static library, do static libraries have the information as well? If so, under which circumstances?
Yes. Static libraries can contain llvm-IR-bitcode also.
Build Settings->Enable Bitcode
, Switch to Yes
Product->Archive
otool -l libDemo.a
__bitcode
and check whether the size
is bigger than 000001 or not.size
> 000001 : then the static lib contain llvm-IR-bitcodeWish this answers your question.