This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] cp/decl.c: Remove delete_block.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 16 Jan 2005 09:48:25 -0500 (EST)
- Subject: [patch] cp/decl.c: Remove delete_block.
Hi,
Attached is a patch to remove delete_block as it is unused.
AFAICT, the last use of delete_block was removed in
1999-09-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (finish_stmt_expr): Change prototype.
* expr.c (cplus_expand_expr): Adjust call accordingly.
* init.c (finish_init_stmts): Likewise.
* parse.y (primary): Likewise.
* pt.c (tsubst_copy): Likewise.
* semantics.c (finish_stmt_expr): Don't take two parameters.
:
:
So it's been unused for more than 5 years.
Bootstrapped on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-01-16 Kazu Hirata <kazu@cs.umass.edu>
* decl.c (delete_block): Remove.
* cp-tree.h: Remove the corresponding prototype.
Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.1088
diff -u -d -p -r1.1088 cp-tree.h
--- cp-tree.h 10 Jan 2005 19:37:05 -0000 1.1088
+++ cp-tree.h 16 Jan 2005 10:42:35 -0000
@@ -3752,7 +3752,6 @@ extern void cxx_pop_function_context (s
extern void cxx_mark_function_context (struct function *);
extern void maybe_push_cleanup_level (tree);
extern void finish_scope (void);
-extern void delete_block (tree);
extern void add_block_current_level (tree);
extern void push_switch (tree);
extern void pop_switch (void);
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1352
diff -u -d -p -r1.1352 decl.c
--- decl.c 6 Jan 2005 20:21:08 -0000 1.1352
+++ decl.c 16 Jan 2005 10:42:37 -0000
@@ -742,29 +742,6 @@ poplevel (int keep, int reverse, int fun
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, block);
}
-/* Delete the node BLOCK from the current binding level.
- This is used for the block inside a stmt expr ({...})
- so that the block can be reinserted where appropriate. */
-
-void
-delete_block (tree block)
-{
- tree t;
- if (current_binding_level->blocks == block)
- current_binding_level->blocks = TREE_CHAIN (block);
- for (t = current_binding_level->blocks; t;)
- {
- if (TREE_CHAIN (t) == block)
- TREE_CHAIN (t) = TREE_CHAIN (block);
- else
- t = TREE_CHAIN (t);
- }
- TREE_CHAIN (block) = NULL_TREE;
- /* Clear TREE_USED which is always set by poplevel.
- The flag is set again if insert_block is called. */
- TREE_USED (block) = 0;
-}
-
/* Insert BLOCK at the end of the list of subblocks of the
current binding level. This is used when a BIND_EXPR is expanded,
to handle the BLOCK node inside the BIND_EXPR. */