This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Remove nested function support remnants
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Sep 2003 20:11:44 +0200
- Subject: Re: [C++ PATCH] Remove nested function support remnants
- References: <1063632819.3989.2.camel@steven.lr-s.tudelft.nl> <m34qzexioa.fsf@uniton.integrable-solutions.net> <1063640418.10388.3.camel@minax.codesourcery.com> <1063645375.3988.74.camel@steven.lr-s.tudelft.nl> <1063646665.24901.530.camel@doubledemon.codesourcery.com>
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 ----