PR22034

Mark Mitchell mark@codesourcery.com
Wed Aug 10 23:00:00 GMT 2005


Jan Hubicka wrote:
> Hi,
> The problem is that statics inside classes have TYPEs as contextes.  I think
> proper fix is to unwind them up to the containing scope.
> 
> Bootstrapped/regtested i686-pc-gnu-linux, OK?
> 
>         /* For local statics lookup proper context die.  */
>         if (TREE_STATIC (decl) && decl_function_context (decl))
> ! 	{
> ! 	  tree context = DECL_CONTEXT (decl);
> ! 
> ! 	  while (TYPE_P (context))
> ! 	    context = TYPE_CONTEXT (context);
> ! 	  context_die = lookup_decl_die (context);
> ! 	}

Note that you can then end up with a FUNCTION_DECL as the context again. 
  Like:

   void f() {
    struct S {
      void g() {
        struct T {
          virtual void f();
        };
      }
    }
  }

The virtual table for T will be inside lots of things.

So, don't you need to iterate on both conditions?

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc-patches mailing list