This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: [GCC front end] add new TREE CODE
- From: Ian Lance Taylor <iant at google dot com>
- To: charfi asma <charfiasma at yahoo dot fr>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 14 Feb 2011 09:47:39 -0800
- Subject: Re: [GCC front end] add new TREE CODE
- References: <64888.39441.qm@web28511.mail.ukl.yahoo.com>
charfi asma <charfiasma@yahoo.fr> writes:
> I am developping my own gcc front end. My source language contains concepts that
> are not represented directly in C code.
> to compile those elements, I think that I should add a new tree codes to my
> front end as C++ does for templates...
> I think that I should also implement how to translate this new tree code in
> Gimple.
> my question is : should I also care about how to translate those tree code al
> over the compiler chain: gimple --> ssa --> unssa --> rtl --> ass ...
> 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.
First let me say that if your language is very different from C you
probably shouldn't be using trees at all.
But if your language is mostly like C then using trees is reasonable.
Even the C frontend itself has language-specific tree codes; see
c-family/c-common.def. Or look at Objective C, at objc/objc-tree.def.
Ian