From a programmer's point of view, the CodeWarrior compiler translates source code into object code. Internally, however, the CodeWarrior compiler organizes its work between its front-end and back-end, each end taking several steps. The following figure shows the steps the compiler takes.
Front-end steps:
- read settings
: retrieves your settings from the host's integrated development environment (IDE) or the command line to configure how to perform subsequent steps
- read and preprocess source code
: reads your program's source code files and applies preprocessor directives
- translate to intermediate representation
: translates your program's preprocessed source code into a platform-independent intermediate representation
- optimize intermediate representation
: rearranges the intermediate representation to reduce your program's size, improve its performance, or both
Back-end steps:
- translate to processor object code
: converts the optimized intermediate representation into native object code, containing data and instructions, for the target processor
- optimize object code
: rearranges the native object code to reduce its size, improve performance, or both
- output object code and diagnostic data
: writes output files on the host system, ready for the linker and diagnostic tools such as a debugger or profiler