3. Single Pass Compiler
• Source code directly transforms into
machine code.
– For example Pascal
source
code
target
code
Front EndCompiler
4. Two Pass Compiler
• Use intermediate representation
– Why?
source
code
target
code
Front End Back End
IR
Front End
5. Two pass compiler
• intermediate representation (IR)
• front end maps legal code into IR
• back end maps IR onto target machine
• simplify retargeting
• allows multiple front ends
• multiple passes ⇒ better code
5
7. Comparison
• One pass compilers are generally faster than
Multipass Compilers
• Multipass ensures the correctness of small
program rather than the correctness of a
large program (high quality code)