Hi,

On Mon, 4 Apr 2011, Nathan Froyd wrote:

> On Mon, Apr 04, 2011 at 05:52:00PM +0200, Steven Bosscher wrote:
> > Have you looked into maybe putting the CODE_LABEL for a LABEL_DECL in
> > an on-the-side structure (hash table, whatever)? It looks like it is
> > only used during expansion of SWITCH statements.
> 
> I haven't, though it'd be easy enough once all accesses go through
> label_rtx.  I'd be equally happy doing that instead of pushing DECL_RTX
> down.

I have a preference in having just one DECL_RTL field for conceptual 
reasons:

Most DECLs are actually objects (there are some prominent exceptions, but 
those always would be better described with something like NAMED_ENTITY, 
if we had something like that, namespaces and translation_unit would 
qualify).  All these have a RTL representation, so one field for them 
seems appropriate.  That some of those don't have a size (either because 
size makes no sense or is always available via type size) hints towards a 
problem in the inheritance.  I would think it should look like so:

decl_common {}  # no size, no rtl, no align, no pt_uid
decl_with_rtl : decl_common {
  # add rtl, align, pt_uid
}
decl_with_size : decl_with_rtl {
  # add size, size_unit
}

Then decl_common can still be used for 
imported_decl/namespace/translation_unit; objects 
are at least decl_with_rtl, and some objects will be decl_with_size.


Ciao,
Michael.
5B

Reply via email to