From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20066 invoked by alias); 21 Feb 2011 11:18:00 -0000 Received: (qmail 20058 invoked by uid 22791); 21 Feb 2011 11:18:00 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from nm18.bullet.mail.ukl.yahoo.com (HELO nm18.bullet.mail.ukl.yahoo.com) (217.146.183.192) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Mon, 21 Feb 2011 11:17:56 +0000 Received: from [217.146.183.214] by nm18.bullet.mail.ukl.yahoo.com with NNFMP; 21 Feb 2011 11:17:53 -0000 Received: from [217.146.183.161] by tm7.bullet.mail.ukl.yahoo.com with NNFMP; 21 Feb 2011 11:17:53 -0000 Received: from [127.0.0.1] by omp1002.mail.ukl.yahoo.com with NNFMP; 21 Feb 2011 11:17:53 -0000 Received: (qmail 76140 invoked by uid 60001); 21 Feb 2011 11:17:53 -0000 Message-ID: <741091.71307.qm@web28516.mail.ukl.yahoo.com> Received: from [132.166.132.113] by web28516.mail.ukl.yahoo.com via HTTP; Mon, 21 Feb 2011 11:17:53 GMT References: <64888.39441.qm@web28511.mail.ukl.yahoo.com> <4D596AEA.7030705@andihellmund.com> Date: Mon, 21 Feb 2011 11:26:00 -0000 From: charfi asma Subject: Re : [GCC front end] add new TREE CODE To: Andi Hellmund Cc: gcc-help@gcc.gnu.org In-Reply-To: <4D596AEA.7030705@andihellmund.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00321.txt.bz2 ----- Message d'origine ---- De : Andi Hellmund =C0 : charfi asma Cc : gcc-help@gcc.gnu.org Envoy=E9 le : Lun 14 f=E9vrier 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 cod= e al > over the compiler chain: gimple --> ssa --> unssa --> rtl --> ass ... >=20=20=20=20 The idea of GCC's modularization is that a front-end should maximally care = about=20 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 s= ome > tree code cause the C++ one seems to be mature and complete. >=20=20=20=20 Yes, the C++ front-end uses quite a lot of own TREE codes, but I would then= =20 start with a very simple one and check how it "translates" the TREE codes i= nto a=20 GIMPLE sequence, e.g. by looking at the 'gimplify_expr' language hook which= is=20 'cp_gimplify_expr' for C++. I hope that helps. If you have any further question about the specific=20 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, ..= .)=20 but there is some difference, for example, I have State and transitions con= cepts=20 which I can translate in C (set of states presented as enumerations and=20 transitions as array of a defined type Transition which is a struct with so= urce=20 state, target state, guard, ...) what I want to try, is to add a new tree codes to directly translate State,= =20 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 sho= uld=20 not use trees. Have you any idea of what I can use instead ?=20 I look at the ghdl front end and I did not find vhdl-tree.def to see if the= y=20 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=20 the java one also. thank you again for your help Asma