The Gateway to Computer Science Excellence
+1 vote

in Compiler Design by | 230 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.
selected by

Related questions

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
52,345 questions
60,489 answers
95,297 users