How to make clang compile to llvm IR

Given some C/C++ file foo.c: > clang -S -emit-llvm foo.c Produces foo.ll which is an LLVM IR file. The -emit-llvm option can also be passed to the compiler front-end directly, and not the driver by means of -cc1: > clang -cc1 foo.c -emit-llvm Produces foo.ll with the IR. -cc1 adds some cool options like -ast-print. … Read more

iOS library to BitCode

When building static libraries you must add the following for bitcode generation: -fembed-bitcode for a dynamic library you need to additionally link with -fembed-bitcode Note: This command is only available with Xcode7+ In regards to the accepted answer of using -fembed-bitcode-marker You should be aware that a normal build with the -fembed-bitcode-marker option will produce … Read more

What does ENABLE_BITCODE do in xcode 7?

Bitcode refers to to the type of code: “LLVM Bitcode” that is sent to iTunes Connect. This allows Apple to use certain calculations to re-optimize apps further (e.g: possibly downsize executable sizes). If Apple needs to alter your executable then they can do this without a new build being uploaded. This differs from: Slicing which … Read more