On Tue, 3 May 2011, Eric Botcazou wrote:

> > I am however completely missing the point of this langhook and doc is not
> > exactly informative either:
> >
> >   /* Returns nonzero if we are in the global binding level.  Ada
> >      returns -1 for an undocumented reason used in stor-layout.c.  */
> >
> > What is the purpose of this hook?
> 
> I've seen things far more undocumented in GCC than this one ;-)
> 
> 
> tree
> variable_size (tree size)
> {
> 
> [...]
> 
>   /* If the language-processor is to take responsibility for variable-sized
>      items (e.g., languages which have elaboration procedures like Ada),
>      just return SIZE unchanged.  */
>   if (lang_hooks.decls.global_bindings_p () < 0)
>     return size;

In my view we should require front ends to take responsibility for 
variable-size types, and get rid of this language-independent function 
(copying such parts as are needed into the front ends that need them).  C 
for example uses its own version as the language-independent one isn't 
right for C.  Similarly, the pending_size code should be local to front 
ends.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to