Lazy allocation of DECL_ASSEMBLER_NAME

Jan Hubicka hubicka@ucw.cz
Tue Mar 2 17:11:00 GMT 2004


> 
> >
> >Could you mention this in the documentation of DECL_ASSEMBLER_NAME in
> >c-tree.texi?
> > 
> >
> I committed the attached patch to the mainline.
>   
> + Using @code{DECL_ASSEMBLER_NAME} will cause additional memory to be
> + allocated (for the mangled name of the entity) so it should be used
> + only when emitting assembly code.  It should not be used within the
> + optimizers to determine whether or not two declarations are the same,
> + even though some of the existing optimizers do use it in that way.
> + These uses will be removed over time.
> + 

OK, so to summarize the sitaution, the conclusion is that the DECL nodes
shall be unique now and thus using DECL_ID indexed hash table shall be
safe?
Also I need to get nodes from identifier names back in varasm.c (while
outputting them).  Is there some comfortable way to get the DECLs back
without having two hashtables?

Would it be OK if I did it once the cgraph merge patch is settled down?

Honza

>   @item DECL_EXTERNAL
>   This predicate holds if the function is undefined.
>   
>   @item TREE_PUBLIC
>   This predicate holds if the function has external linkage.



More information about the Gcc mailing list