[GCC front end] add new TREE CODE
charfi asma
charfiasma@yahoo.fr
Mon Feb 21 11:26:00 GMT 2011
----- Message d'origine ----
De : Andi Hellmund <mail@andihellmund.com>
À : charfi asma <charfiasma@yahoo.fr>
Cc : gcc-help@gcc.gnu.org
Envoyé le : Lun 14 février 2011, 18h 48min 26s
Objet : Re: [GCC front end] add new TREE CODE
Hey Asma,
> my question is : should I also care about how to translate those tree code al
> over the compiler chain: gimple --> ssa --> unssa --> rtl --> ass ...
>
The idea of GCC's modularization is that a front-end should maximally care about
GIMPLE. All the other transformations are done by the middle-end.
> did you suggest to follow an example of an existing front end that adds some
> tree code cause the C++ one seems to be mature and complete.
>
Yes, the C++ front-end uses quite a lot of own TREE codes, but I would then
start with a very simple one and check how it "translates" the TREE codes into a
GIMPLE sequence, e.g. by looking at the 'gimplify_expr' language hook which is
'cp_gimplify_expr' for C++.
I hope that helps. If you have any further question about the specific
transformation from TREE codes to GIMPLE, just let us know ...
Andi
Hello,
thank you Andi and Ian for your help ;)
In fact, my language is moslty like C (var, function, call exp, if else, ...)
but there is some difference, for example, I have State and transitions concepts
which I can translate in C (set of states presented as enumerations and
transitions as array of a defined type Transition which is a struct with source
state, target state, guard, ...)
what I want to try, is to add a new tree codes to directly translate State,
transtion, event, ... and do not use Array, enumeration of C language.
Ian said in his response that if my language is very different than C I should
not use trees. Have you any idea of what I can use instead ?
I look at the ghdl front end and I did not find vhdl-tree.def to see if they
defined a new tree code for this fe.
I asked the question in their mailing list but I did not get an answer :(
I will probably (as you suggested before) look at the cp front end and may be
the java one also.
thank you again for your help
Asma
More information about the Gcc-help
mailing list