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

asked in Compiler Design by Loyal (7.9k points) | 158 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

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

35,458 questions
42,706 answers
42,105 users