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: [C++ PATCH] Remove nested function support remnants


Op ma 15-09-2003, om 19:24 schreef Mark Mitchell:
> > Bootstrapped and regtested on i686-pc-linux-gnu.  OK?
> 
> I suspect not, actually.  The function_depth stuff is necessary not for
> the case of lexical nesting, but for things like a function
> instantiating a template and then emitting the template.
> 
> I think you should stick with just removing the block you originally
> pointed out.

Hmm it doesn't cause anything to fail so to pre-empt future trouble
maybe you can come up with a test case? (I'm not much into C++
myself...)

So this is OK, then?

Gr.
Steven


	* decl.c (poplevel): Remove old code to output nested functions.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1126
diff -c -3 -p -r1.1126 decl.c
*** decl.c	15 Sep 2003 00:59:27 -0000	1.1126
--- decl.c	15 Sep 2003 16:42:31 -0000
*************** poplevel (int keep, int reverse, int fun
*** 1179,1206 ****
    else
      decls = current_binding_level->names;
  
-   /* Output any nested inline functions within this block
-      if they weren't already output.  */
-   for (decl = decls; decl; decl = TREE_CHAIN (decl))
-     if (TREE_CODE (decl) == FUNCTION_DECL
- 	&& ! TREE_ASM_WRITTEN (decl)
- 	&& DECL_INITIAL (decl) != NULL_TREE
- 	&& TREE_ADDRESSABLE (decl)
- 	&& decl_function_context (decl) == current_function_decl)
-       {
- 	/* If this decl was copied from a file-scope decl
- 	   on account of a block-scope extern decl,
- 	   propagate TREE_ADDRESSABLE to the file-scope decl.  */
- 	if (DECL_ABSTRACT_ORIGIN (decl) != NULL_TREE)
- 	  TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
- 	else
- 	  {
- 	    push_function_context ();
- 	    output_inline_function (decl);
- 	    pop_function_context ();
- 	  }
-       }
- 
    /* When not in function-at-a-time mode, expand_end_bindings will
       warn about unused variables.  But, in function-at-a-time mode
       expand_end_bindings is not passed the list of variables in the
--- 1174,1179 ----


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