This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[java] remove some unused functions
- From: "Ben Elliston" <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 17 Nov 2004 18:46:25 +1100
- Subject: [java] remove some unused functions
Okay for mainline?
2004-11-09 Ben Elliston <bje@au.ibm.com>
* typeck.c (convert_to_boolean): Make static.
(convert_to_char): Likewise.
* convert.h (convert_to_boolean): Remove declaration.
(convert_to_char): Likewise.
* java-tree.h (java_inlining_merge_static_initializers): Remove.
(java_inlining_map_static_initializers): Likewise.
* lang.c (merge_init_test_initialization): Remove.
(inline_init_test_initialization): Likewise.
(java_inlining_merge_static_initializers): Likewise.
(java_inlining_map_static_initializers): Likewise.
Index: convert.h
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/java/convert.h,v
retrieving revision 1.6
diff -u -p -r1.6 convert.h
--- convert.h 9 Jan 2003 23:16:50 -0000 1.6
+++ convert.h 17 Nov 2004 07:43:44 -0000
@@ -20,8 +20,6 @@ Boston, MA 02111-1307, USA. */
/* Written by Jeffrey Hsu <hsu@cygnus.com> */
-extern tree convert_to_boolean (tree, tree);
-extern tree convert_to_char (tree, tree);
extern tree convert_to_integer (tree type, tree expr);
extern tree convert_to_real (tree type, tree expr);
extern tree convert_to_pointer (tree type, tree expr);
Index: java-tree.h
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/java/java-tree.h,v
retrieving revision 1.220
diff -u -p -r1.220 java-tree.h
--- java-tree.h 5 Oct 2004 17:07:13 -0000 1.220
+++ java-tree.h 17 Nov 2004 07:43:45 -0000
@@ -1331,9 +1331,6 @@ extern tree decl_constant_value (tree);
extern void java_mark_class_local (tree);
-extern void java_inlining_merge_static_initializers (tree, void *);
-extern void java_inlining_map_static_initializers (tree, void *);
-
extern void compile_resource_data (const char *name, const char *buffer, int);
extern void compile_resource_file (const char *, const char *);
extern void write_resource_constructor (tree *);
Index: lang.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/java/lang.c,v
retrieving revision 1.162
diff -u -p -r1.162 lang.c
--- lang.c 15 Oct 2004 18:43:10 -0000 1.162
+++ lang.c 17 Nov 2004 07:43:45 -0000
@@ -59,8 +59,6 @@ static void put_decl_node (tree);
static void java_print_error_function (diagnostic_context *, const char *);
static tree java_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
void *, struct pointer_set_t *);
-static int merge_init_test_initialization (void * *, void *);
-static int inline_init_test_initialization (void * *, void *);
static bool java_can_use_bit_fields_p (void);
static bool java_dump_tree (void *, tree);
static void dump_compound_expr (dump_info_p, tree);
@@ -762,98 +760,6 @@ java_tree_inlining_walk_subtrees (tree *
we must merge the DECL_FUNCTION_INIT_TEST_TABLE from the function
being inlined and create the boolean variables in the outermost
scope of the method being inlined into. */
-
-/* Create a mapping from a boolean variable in a method being inlined
- to one in the scope of the method being inlined into. */
-
-static int
-merge_init_test_initialization (void **entry, void *x)
-{
- struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
- splay_tree decl_map = (splay_tree)x;
- splay_tree_node n;
- tree *init_test_decl;
-
- /* See if we have remapped this declaration. If we haven't there's
- a bug in the inliner. */
- n = splay_tree_lookup (decl_map, (splay_tree_key) ite->value);
- if (! n)
- abort ();
-
- /* Create a new entry for the class and its remapped boolean
- variable. If we already have a mapping for this class we've
- already initialized it, so don't overwrite the value. */
- init_test_decl = java_treetreehash_new
- (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ite->key);
- if (!*init_test_decl)
- *init_test_decl = (tree)n->value;
-
- /* This fixes a weird case.
-
- The front end assumes that once we have called a method that
- initializes some class, we can assume the class is initialized. It
- does this by setting the DECL_INITIAL of the init_test_decl for that
- class, and no initializations are emitted for that class.
-
- However, what if the method that is suppoed to do the initialization
- is itself inlined in the caller? When expanding the called method
- we'll assume that the class initialization has already been done,
- because the DECL_INITIAL of the init_test_decl is set.
-
- To fix this we remove the DECL_INITIAL (in the caller scope) of all
- the init_test_decls corresponding to classes initialized by the
- inlined method. This makes the caller no longer assume that the
- method being inlined does any class initializations. */
- DECL_INITIAL (*init_test_decl) = NULL;
-
- return true;
-}
-
-/* Merge the DECL_FUNCTION_INIT_TEST_TABLE from the function we're
- inlining. */
-
-void
-java_inlining_merge_static_initializers (tree fn, void *decl_map)
-{
- htab_traverse
- (DECL_FUNCTION_INIT_TEST_TABLE (fn),
- merge_init_test_initialization, decl_map);
-}
-
-/* Lookup a DECL_FUNCTION_INIT_TEST_TABLE entry in the method we're
- inlining into. If we already have a corresponding entry in that
- class we don't need to create another one, so we create a mapping
- from the variable in the inlined class to the corresponding
- pre-existing one. */
-
-static int
-inline_init_test_initialization (void **entry, void *x)
-{
- struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
- splay_tree decl_map = (splay_tree)x;
-
- tree h = java_treetreehash_find
- (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ite->key);
- if (! h)
- return true;
- splay_tree_insert (decl_map,
- (splay_tree_key) ite->value,
- (splay_tree_value) h);
- return true;
-}
-
-/* Look up the boolean variables in the DECL_FUNCTION_INIT_TEST_TABLE
- of a method being inlined. For each hone, if we already have a
- variable associated with the same class in the method being inlined
- into, create a new mapping for it. */
-
-void
-java_inlining_map_static_initializers (tree fn, void *decl_map)
-{
- htab_traverse
- (DECL_FUNCTION_INIT_TEST_TABLE (fn),
- inline_init_test_initialization, decl_map);
-}
/* Avoid voluminous output for deep recursion of compound exprs. */
Index: typeck.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/java/typeck.c,v
retrieving revision 1.72
diff -u -p -r1.72 typeck.c
--- typeck.c 25 Aug 2004 09:52:53 -0000 1.72
+++ typeck.c 17 Nov 2004 07:43:45 -0000
@@ -39,6 +39,8 @@ The Free Software Foundation is independ
#include "toplev.h"
#include "ggc.h"
+static tree convert_to_boolean (tree, tree);
+static tree convert_to_char (tree, tree);
static tree convert_ieee_real_to_integer (tree, tree);
static tree parse_signature_type (const unsigned char **,
const unsigned char *);
@@ -160,13 +162,13 @@ convert (tree type, tree expr)
}
-tree
+static tree
convert_to_char (tree type, tree expr)
{
return build1 (NOP_EXPR, type, expr);
}
-tree
+static tree
convert_to_boolean (tree type, tree expr)
{
return build1 (NOP_EXPR, type, expr);