[patch] tree.c: Remove two unused functions.
Kazu Hirata
kazu@cs.umass.edu
Wed Mar 23 00:46:00 GMT 2005
Hi,
Attached is a patch to remove two unused functions.
Bootstrapped on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-03-22 Kazu Hirata <kazu@cs.umass.edu>
* tree.c (get_set_constructor_bits,
get_set_constructor_bytes): Remove.
* tree.h: Remove the corresponding prototypes.
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.470
diff -u -d -p -r1.470 tree.c
--- tree.c 16 Mar 2005 09:01:20 -0000 1.470
+++ tree.c 22 Mar 2005 20:29:07 -0000
@@ -5357,99 +5357,6 @@ get_file_function_name (int kind)
return get_file_function_name_long (p);
}
-/* Expand (the constant part of) a SET_TYPE CONSTRUCTOR node.
- The result is placed in BUFFER (which has length BIT_SIZE),
- with one bit in each char ('\000' or '\001').
-
- If the constructor is constant, NULL_TREE is returned.
- Otherwise, a TREE_LIST of the non-constant elements is emitted. */
-
-tree
-get_set_constructor_bits (tree init, char *buffer, int bit_size)
-{
- int i;
- tree vals;
- HOST_WIDE_INT domain_min
- = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init))), 0);
- tree non_const_bits = NULL_TREE;
-
- for (i = 0; i < bit_size; i++)
- buffer[i] = 0;
-
- for (vals = TREE_OPERAND (init, 1);
- vals != NULL_TREE; vals = TREE_CHAIN (vals))
- {
- if (!host_integerp (TREE_VALUE (vals), 0)
- || (TREE_PURPOSE (vals) != NULL_TREE
- && !host_integerp (TREE_PURPOSE (vals), 0)))
- non_const_bits
- = tree_cons (TREE_PURPOSE (vals), TREE_VALUE (vals), non_const_bits);
- else if (TREE_PURPOSE (vals) != NULL_TREE)
- {
- /* Set a range of bits to ones. */
- HOST_WIDE_INT lo_index
- = tree_low_cst (TREE_PURPOSE (vals), 0) - domain_min;
- HOST_WIDE_INT hi_index
- = tree_low_cst (TREE_VALUE (vals), 0) - domain_min;
-
- gcc_assert (lo_index >= 0);
- gcc_assert (lo_index < bit_size);
- gcc_assert (hi_index >= 0);
- gcc_assert (hi_index < bit_size);
- for (; lo_index <= hi_index; lo_index++)
- buffer[lo_index] = 1;
- }
- else
- {
- /* Set a single bit to one. */
- HOST_WIDE_INT index
- = tree_low_cst (TREE_VALUE (vals), 0) - domain_min;
- if (index < 0 || index >= bit_size)
- {
- error ("invalid initializer for bit string");
- return NULL_TREE;
- }
- buffer[index] = 1;
- }
- }
- return non_const_bits;
-}
-
-/* Expand (the constant part of) a SET_TYPE CONSTRUCTOR node.
- The result is placed in BUFFER (which is an array of bytes).
- If the constructor is constant, NULL_TREE is returned.
- Otherwise, a TREE_LIST of the non-constant elements is emitted. */
-
-tree
-get_set_constructor_bytes (tree init, unsigned char *buffer, int wd_size)
-{
- int i;
- int set_word_size = BITS_PER_UNIT;
- int bit_size = wd_size * set_word_size;
- int bit_pos = 0;
- unsigned char *bytep = buffer;
- char *bit_buffer = alloca (bit_size);
- tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size);
-
- for (i = 0; i < wd_size; i++)
- buffer[i] = 0;
-
- for (i = 0; i < bit_size; i++)
- {
- if (bit_buffer[i])
- {
- if (BYTES_BIG_ENDIAN)
- *bytep |= (1 << (set_word_size - 1 - bit_pos));
- else
- *bytep |= 1 << bit_pos;
- }
- bit_pos++;
- if (bit_pos >= set_word_size)
- bit_pos = 0, bytep++;
- }
- return non_const_bits;
-}
-
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
/* Complain that the tree code of NODE does not match the expected 0
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.705
diff -u -d -p -r1.705 tree.h
--- tree.h 22 Mar 2005 17:36:37 -0000 1.705
+++ tree.h 22 Mar 2005 20:29:07 -0000
@@ -3460,8 +3460,6 @@ extern GTY(()) const char * current_func
extern unsigned crc32_string (unsigned, const char *);
extern void clean_symbol_name (char *);
extern tree get_file_function_name_long (const char *);
-extern tree get_set_constructor_bits (tree, char *, int);
-extern tree get_set_constructor_bytes (tree, unsigned char *, int);
extern tree get_callee_fndecl (tree);
extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree);
More information about the Gcc-patches
mailing list