This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re : Re : Re : Re : Re : Re : [GCC front end] trying to install sample_fe but fail in make


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]