
The improvements to build times though are limited since this option still uses the GCC frontend parser and for debug builds (which are probably what you are building most often) it does not make use of the optimizer. The main reason to switch to LLVM-GCC is that it offers both performance gains and faster build times. This is now the default compiler in Xcode 4 for new projects but you can also choose it for Xcode 3 projects. This hybrid option uses LLVM as an optimizer and code generator plug-in to the GCC front end parser. GCC 4.2 is the default compiler for Xcode 3 and for now remains an option in Xcode 4. If you need to stick with GCC 4.2 you can but Apple has stated that they are no longer fixing bugs in GCC so this is not a long term option. The implications for each of these options varies a little depending on whether you are using Xcode 3 or Xcode 4 and also whether you are targeting iOS or Mac OS X.

The diagram below shows the differences between the three options: I am ignoring the GCC 4.0 option as that is now deprecated and is not even present in Xcode 4.

There are really three compiler options depending on whether you want to stick with GCC, switch to LLVM or use a hybrid approach for backward compatibility. You can set the compiler you want to use in Xcode in the build settings for a project or target The compiler options vary slightly between Xcode 3 and 4 as shown below: In this post I’ll take a look at the options for both Xcode 3 and 4. Xcode 4 exploits this modular approach to provide features such as improved syntax highlighting and to suggest fixes to common coding errors.Īs of writing GCC remains the default compiler for Xcode 3 but with the release of Xcode 4 the default compiler for new projects has changed to LLVM-GCC. Other tools in the LLVM project include the Clang frontend parser and the LLDB debugger. The LLVM project is an open source collection of tools (see for the full list) that build on a core set of libraries that provide an optimizer and code generator.

The LLVM based tools are available (with some differences) to both Xcode 3 and 4 so you do not have to wait until you migrate to Xcode 4 to start taking advantage of it. Apple is slowly phasing out support for GCC and moving to new compiler technologies based on the Low Level Virtual Machine (LLVM) open source project.

Chances are if you are using Xcode 3 and you haven’t played with the build settings for a project that you are still using the GNU Compiler Collection, GCC.
