The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+1 vote

asked in Compiler Design by Boss (9.5k points) | 137 views

1 Answer

+2 votes
Best answer
I'd go with option C, since that's fundamentally the purpose of using intermediate code (another one is to perform high level optimizations).

For instance, GCC has got two intermediate langauges - "GIMPLE" and "RTL". The front-end translates source into GIMPLE on which high-level optimizations are done, and then lowers to RTL on, which low-level target speciifc optimizations are performed. One can leverage the optimizations in GCC by writing a front-end and a back-end for GCC as opposed to re-writing the "middle-end". In a nutshell by using an IR, writing m front-ends and n back-ends is sufficient as opposed to writing m * n compilers.
answered by (353 points)
selected by

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

33,620 questions
40,170 answers
38,552 users