This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re : Re : Re : Re : Re : Re : [GCC front end] trying to install sample_fe but fail in make
- From: charfi asma <charfiasma at yahoo dot fr>
- To: Andi Hellmund <mail at andihellmund dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 16 Jul 2010 07:08:01 -0700 (PDT)
- Subject: Re : Re : Re : Re : Re : Re : [GCC front end] trying to install sample_fe but fail in make
- References: <961323.52443.qm@web28502.mail.ukl.yahoo.com> <7c01c91296c0beecfe4d6761073628bb-EhVcXl1CTQJeRwgeDAw3AF9BdAJSS1xcXV9EBF41WEVGVFENQV5+BEtdXjBeQ0IHWVxaSF9d-webmailer2@server04.webmailer.hosteurope.de> <285937.98277.qm@web28506.mail.ukl.yahoo.com> <e72b799b44c5b94d0bdf752b554f2851-EhVcXl1CTQJeRwgeDAw3AF9BdAJSS1xcXV9EBF41WEVdS10OQVl+H1dUWzBeQ0IHVlteRl9S-webmailer2@server08.webmailer.hosteurope.de> <284878.42130.qm@web28506.mail.ukl.yahoo.com> <AANLkTimBwfoGdgaz19gkeFoKhbnloKYT0VpVMmjVUgtA@mail.gmail.com> <730386.47129.qm@web28514.mail.ukl.yahoo.com> <4C0E91ED.6050600@andihellmund.com> <895794.48229.qm@web28503.mail.ukl.yahoo.com> <4C228DAC.4000704@andihellmund.com> <AANLkTikGkLl2lTuNwJKjCRVvims6Sezri-9rrc9WU3GD@mail.gmail.com> <947445.22128.qm@web28503.mail.ukl.yahoo.com> <4C23C78C.2040903@andihellmund.com>
Hello,
I run the sfe_example and it works perfectly.
when I call gsfe -s file1.sfe, I get the file1.s which is nearly the same
assembly generated when compiling the same c code with gcc.
But now, I want to understand How it works ;)
I look at the code of sfe_example.c and sfe1.c.
I understand that sfe1 define a tree for each variable /type /c function in the
c code, for example for the global_var, we have the function :
create_decl_global_var() of type tree, etc
in the sfe1.c, those functions are called in the getdecls(void) but this
function tree getdecls(void) is never called
so my questions are:
1. who calls all sfe1.c functions ( sfe_parse_file, getdecls, ...) ?
2. when we call the sfe1.c, is the result equal to the generic form of the c
code ? In which file this form is stocked ?
although I think that the body of each funcion of sfe1_example.c is writen in
generic but I am not sure (generic is a list of tree code just like gimple)
when I compile the same c code using gcc and dump the gimple form, I expected
that the generic form is close to the gimple one, am I write ?
3. I do not really understand this code in the sfe1.h
struct lang_identifier GTY(())
{
struct tree_identifier common;
};
union lang_tree_node GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
{
union tree_node GTY ((tag ("0"), desc ("tree_node_structure (&%h)")))
generic;
struct lang_identifier GTY ((tag ("1"))) identifier;
};
thank you very much
Asma
________________________________
De : Andi Hellmund <mail@andihellmund.com>
À : charfi asma <charfiasma@yahoo.fr>
Envoyé le : Jeu 24 juin 2010, 23h 01min 00s
Objet : Re: Re : Re : Re : Re : Re : [GCC front end] trying to install
sample_fe
but fail in make
Hey,
please find attached a version of the front-end with the example from the blog.
It's been some time that I tested this code, so hopefully it is still working.
If not, you would however get an impression on howto create GENERIC IR.
Best regards,
Andi