Appendix C: Understanding Compiler Technology
In This Appendix
Introducing GCC Moving to LLVM Introducing Clang Selecting a compiler
One of the biggest changes between Xcode 3 and Xcode 4 is almost completely invisible. Xcode 4 begins a move away from the GCC (GNU Compiler Collection) frontend and code generator to a new compiler technology called LLVM (Low Level Virtual Machine). This small change has big implications for the future of Xcode and has influenced the design of some of the new features in Xcode 4.
Figure C.1 shows the two main components of a compiler. The parser/frontend reads source code written in a given language and converts it into an intermediate list of instructions. This is called intermediate form (IF) code. IF code uses a simplified set of virtual instructions that represents the essential operations and variables in the source in a machine- and language-independent way. IF code also includes a flow graph that optimizes the order in which instructions are processed. Variables may also be rearranged to optimize access.
The code generator module converts the IF code into machine-specific binary. It performs further optimizations that use the specific features of each target processor—for example, managing registers—to create a binary that is as efficient as possible. Most compilers, including Xcode, create binaries with an .o (object file) extension.
The linker, not shown in the figure, resolves variable references across different object files and ...