mirror of git://gcc.gnu.org/git/gcc.git
tree.c (get_set_constructor_bits, [...]): Remove.
* tree.c (get_set_constructor_bits, get_set_constructor_bytes): Remove. * tree.h: Remove the corresponding prototypes. From-SVN: r97057
This commit is contained in:
parent
bef87a346c
commit
86f1f8581b
|
@ -5,6 +5,10 @@
|
||||||
* et-forest.c (et_free_tree_force): New.
|
* et-forest.c (et_free_tree_force): New.
|
||||||
* et-forest.h: Add a prototype for et_free_tree_force.
|
* et-forest.h: Add a prototype for et_free_tree_force.
|
||||||
|
|
||||||
|
* tree.c (get_set_constructor_bits,
|
||||||
|
get_set_constructor_bytes): Remove.
|
||||||
|
* tree.h: Remove the corresponding prototypes.
|
||||||
|
|
||||||
2005-03-25 John David Anglin <dave.anglin@nrc-crnc.gc.ca>
|
2005-03-25 John David Anglin <dave.anglin@nrc-crnc.gc.ca>
|
||||||
|
|
||||||
PR target/15491
|
PR target/15491
|
||||||
|
|
93
gcc/tree.c
93
gcc/tree.c
|
@ -5357,99 +5357,6 @@ get_file_function_name (int kind)
|
||||||
return get_file_function_name_long (p);
|
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)
|
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
|
||||||
|
|
||||||
/* Complain that the tree code of NODE does not match the expected 0
|
/* Complain that the tree code of NODE does not match the expected 0
|
||||||
|
|
|
@ -3460,8 +3460,6 @@ extern GTY(()) const char * current_function_func_begin_label;
|
||||||
extern unsigned crc32_string (unsigned, const char *);
|
extern unsigned crc32_string (unsigned, const char *);
|
||||||
extern void clean_symbol_name (char *);
|
extern void clean_symbol_name (char *);
|
||||||
extern tree get_file_function_name_long (const 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 tree get_callee_fndecl (tree);
|
||||||
extern void change_decl_assembler_name (tree, tree);
|
extern void change_decl_assembler_name (tree, tree);
|
||||||
extern int type_num_arguments (tree);
|
extern int type_num_arguments (tree);
|
||||||
|
|
Loading…
Reference in New Issue