This is the mail archive of the gcc@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]

a "hello world" frontend


Two colleagues (Rafael Dantas de Castro and Gustavo Sverzut Barbieri) and I 
decided to try to make a scheme frontend for gcc. Since the task is proving 
quite difficult we decided to write a very small frontend that could be used 
as a tutorial. We call this small frontend "hello world" because it generates 
a hello world program no matter what it is given as input :)

The frontend is at http://ltc08.ic.unicamp.br/svn/scheme/branches/hello-world

It has some ideas (and comments) from the gcc frontend howto but is designed 
to work with gcc4.

Unfortunately there isn't a lot of documentation and we are not sure if we did 
the wright think in some points. We would be very glad if someone could 
elucidate some of ours doubts:

what is USE_MAPPED_LOCATION for? We have seen some discussion but we are not 
sure about its purpose or if we are using it correctly.

The callbacks: with gcc using GENERIC why it is necessary to call the frontend 
to edit the tree? For example, it seems that getdecls is redundant with the 
information maintained by the call graph module. Why is builtin_function 
necessary? Can't the middle end add the definitions on its on?

We also noticed that many callbacks are the same in treelang, c and fortran. 
Maybe there should be a default implementation.

Are we building string literals correctly? Why is a NOP_EXPR expression 
necessary?

Why it is necessary to set function_end_locus? Can this be done without using 
the cfun global variable?

In a FUNCTION_DECL, what is the difference between DECL_EXTERNAL and (not 
TREE_STATIC)?

But we must also note the current interface looks simpler than the ones 
described in the old documents :)

Thanks for any comment.

Rafael Ãvila de EspÃndola


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