This is the mail archive of the gcc-patches@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: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function


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 ENTRY/EXIT be a base class for basic_block 
> and use a real field (but that can wait).

Actually the other way around (ENTRY/EXIT be a subclass), as it would be 
an additional field to the normal basic blocks.  But for central data 
structures I'm usually of the opinion that jumping through hoops just to 
not enlarge them is quite acceptable :)

> There are other pieces of data that are "global" but context-dependent.  
> I wonder if it wouldn't make sense to encapsulate them in some class 
> that is controlled by the pass manager and gets updated as it moves from 
> function to function (it would contain things like cfun, 
> current_function_decl, etc).

And on that topic: I think it makes sense to eventually get rid of one or 
the other, current_function_decl is always (well, mostly) cfun->decl, if 
cfun happens to be set.  I know there are some roadblocks in front of that 
goal, but still.

Ciao,
Michael.


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