Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-24 Thread Martin Jambor
Hi, On Wed, Aug 22, 2012 at 03:37:48PM +0200, Richard Guenther wrote: > On Wed, Aug 22, 2012 at 3:04 PM, Martin Jambor wrote: > > On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: > >> On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor wrote: > >> > On Wed, Aug 15, 2012 at 05:21:04PM

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-22 Thread Richard Guenther
On Wed, Aug 22, 2012 at 3:04 PM, Martin Jambor wrote: > Hi, > > On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: >> On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor wrote: >> > On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: >> >> Hi, >> >> >> >> On Fri, Aug 10, 2012

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-22 Thread Martin Jambor
Hi, On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: > On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor wrote: > > On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: > >> Hi, > >> > >> On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: > >> > > - ada/gcc-int

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-21 Thread Richard Guenther
On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor wrote: > On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: >> Hi, >> >> On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: >> > > - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls >> > > dump_function which

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-21 Thread Martin Jambor
On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: > Hi, > > On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: > > > - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls > > > dump_function which in turns calls dump_function_to_file which calls > > > push

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Diego Novillo
On Thu, Aug 16, 2012 at 10:21 AM, Michael Matz wrote: > Hi, > > On Thu, 16 Aug 2012, Diego Novillo wrote: > >> I like this approach, particularly since it would be used in contexts >> where there is no simpler scheme. I'm not crazy about overloading >> unused fields, but it's fine if we wrap it a

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Michael Matz
Hi, On Thu, 16 Aug 2012, Diego Novillo wrote: > I like this approach, particularly since it would be used in contexts > where there is no simpler scheme. I'm not crazy about overloading > unused fields, but it's fine if we wrap it around a special accessor. I > suppose we could also make ENTR

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Diego Novillo
On Thu, Aug 16, 2012 at 8:40 AM, Michael Matz wrote: > Hi, > > On Thu, 16 Aug 2012, Richard Guenther wrote: > >> If dumping a statement needs the containing function then we need to >> either pass that down, provide a way to get from statement to function, >> or stop requiring the function. Makin

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Michael Matz
Hi, On Thu, 16 Aug 2012, Richard Guenther wrote: > If dumping a statement needs the containing function then we need to > either pass that down, provide a way to get from statement to function, > or stop requiring the function. Making the hash global is choice three > (deallocating the hash w

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Richard Guenther
On Wed, Aug 15, 2012 at 5:21 PM, Martin Jambor wrote: > Hi, > > On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: >> > - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls >> > dump_function which in turns calls dump_function_to_file which calls >> > push_cfun. But

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-15 Thread Martin Jambor
Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: > > - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls > > dump_function which in turns calls dump_function_to_file which calls > > push_cfun. But Ada front end has its idea of the > > current_function_decl a

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-10 Thread Eric Botcazou
> - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls > dump_function which in turns calls dump_function_to_file which calls > push_cfun. But Ada front end has its idea of the > current_function_decl and there is no cfun which is an inconsistency > which makes push_cfun asse

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-09 Thread Richard Guenther
On Thu, Aug 9, 2012 at 4:26 PM, Martin Jambor wrote: > Hi, > > I've always found it silly that in order to change the current > function one has to call push_cfun and pop_cfun which conveniently set > and restore the value of cfun and in addition to that also set > current_function_decl and usuall

[PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-09 Thread Martin Jambor
Hi, I've always found it silly that in order to change the current function one has to call push_cfun and pop_cfun which conveniently set and restore the value of cfun and in addition to that also set current_function_decl and usually also cache its old value to restore it back afterwards. I also