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

asked in Compiler Design by Loyal (8k points) | 173 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 (351 points)
selected by

Related questions

+2 votes
0 answers
2
asked Jan 14 in Compiler Design by ashwina Active (2.1k points) | 182 views
+2 votes
1 answer
5


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

42,687 questions
48,653 answers
156,494 comments
63,963 users