Intermediate Code Generation: In the process of translating source code into machine code, a compiler may construct one or more intermediate representations, which can have different forms, including trees, graphs, or quadruples. This intermediate code is simple and easy to translate into the target machine. The objective of the intermediate code is to make the translation process easier and more efficient.
Code Generation: After the intermediate code has been generated, the machine-independent code optimization phase attempts to improve the intermediate code so that better target code can be generated. The optimization can have different objectives, including faster execution, shorter code, or code that consumes less power.
Finally, the code generator takes the intermediate representation of the source program and maps it into the target language. The intermediate instructions are translated into sequences of machine instructions that perform the same task as the original program. The output of the code generator is the target code that can be executed on the target machine.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Intermediate Code Generation: In the process of translating source code into machine code, a compiler may construct one or more intermediate representations, which can have different forms, including trees, graphs, or quadruples. This intermediate code is simple and easy to translate into the target machine. The objective of the intermediate code is to make the translation process easier and more efficient.
Code Generation: After the intermediate code has been generated, the machine-independent code optimization phase attempts to improve the intermediate code so that better target code can be generated. The optimization can have different objectives, including faster execution, shorter code, or code that consumes less power.
Finally, the code generator takes the intermediate representation of the source program and maps it into the target language. The intermediate instructions are translated into sequences of machine instructions that perform the same task as the original program. The output of the code generator is the target code that can be executed on the target machine.