This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] Print trees in C syntax
- From: Diego Novillo <dnovillo at redhat dot com>
- To: POP Sebastian <m1sp at csc dot liv dot ac dot uk>
- Cc: Gabriel Dos Reis <gdr at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Dec 2001 16:34:49 -0500
- Subject: Re: [ast-optimizer-branch] Print trees in C syntax
- Organization: Red Hat Canada
- References: <22136.1003775535@localhost.localdomain> <20011122225632.A30650@tornado.cygnus.com> <20011123135939.A12802@linux18.lxfarm.csc.liv.ac.uk> <1006552543.16583.0.camel@tornado> <20011126164523.A17664@linux18.lxfarm.csc.liv.ac.uk> <20011126132433.G19823@redhat.com> <flzo581jry.fsf@riz.cmla.ens-cachan.fr> <20011204213132.B17237@linux18.lxfarm.csc.liv.ac.uk>
On Tue, 04 Dec 2001, POP Sebastian wrote:
> On Tue, Nov 27, 2001 at 01:27:13PM +0100, Gabriel Dos Reis
> wrote:
> > What about: 1) creating a new file -- say c-pretty-print.c
> That was the simplest step.
>
> > 2) move some bits from cp/errors.c into c-pretty-print.c
> Hmm, I think I'll keep the big switch and avoid working with
> small specialized functions. There're lot of interesting things
> in cp/error.c (like the handling template names, ...), but I
> need some more time to finish...
>
> > 3) make your routines take an 'output_buffer *'
> Done.
>
> > 4) make both C and C++ front-end aware of c-pretty-print.c
> Hmm, here I need some more help : I don't want to break
> anything... For the moment I use this as a debugging tool (and
> thus I include the functions debug_c_node, and debug_c_tree)
>
I'd suggest doing a C only version for the time being. Once you
get that working, you (or whoever is interested) can go for the
C++ version. You have code to handle C++ constructs, just remove
it for now. The C++-specific version will have to take care of
those.
> 2001-11-26 Sebastian Pop <s.pop@laposte.net>
> * c-pretty-print.h: New file.
> (print_c_tree): Declare.
> (print_c_node): Declare.
> (debug_c_tree): Declare.
> (debug_c_node): Declare.
> (dump_c_tree): Declare.
> (dump_c_node): Declare.
>
Move these to c-common.h, maybe?
> * c-pretty-print.c: New file.
> (dump_c_scope_vars): Declare static.
> (print_c_tree): New function.
> (print_c_node): New function.
> (debug_c_tree): New function.
> (debug_c_node): New function.
> (dump_c_tree): New function.
> (dump_c_node): New function.
> (dump_c_scope_vars): New function.
>
No need to mention every function for new files.
> +static void
> +dump_c_scope_vars (buffer, scope, spc)
> + output_buffer *buffer;
> + tree scope;
> + HOST_WIDE_INT spc;
> +{
>
Comment.
Do you have a copyright assignment on file? I don't think it's
crucial for the branch, but it will be important when we merge
into the trunk.
Diego.