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] DECL_NO_STATIC_CHAIN -> DECL_STATIC_CHAIN


> This is something we've been discussing on IRC today.  DECL_NO_STATIC_CHAIN
> is ATM quite weird, C++/Ada FEs set it to 1 for new function decls

That cannot be true for Ada, as otherwise the old algorithm in tree-nested.c 
would have prevented the compiler from working.  The flag is only set for 
imported nested functions.

> 	* gcc-interface/utils.c (gnat_pushdecl): Don't set
> 	DECL_NO_STATIC_CHAIN.

Not OK, we need the same treatment as C:

    {
      DECL_CONTEXT (decl) = current_function_decl;

      /* Functions imported in another function are not really nested.  */
      if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl))
       DECL_STATIC_CHAIN (decl) = 1;
    }

-- 
Eric Botcazou


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