This is the mail archive of the 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: [ast-optimizer-branch] Print trees in C syntax

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

> 2001-11-26  Sebastian Pop  <>
>         * 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;
> +{

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.


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