diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1995-02-14 22:39:19 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1995-02-14 22:39:19 -0800 |
commit | f3ffec8eee91e75497006f2d1f4c5a21acdea3d0 (patch) | |
tree | ff190b87c58b32e343005007ff86e14ac8808a65 /gcc | |
parent | 4745ddae5dbd41d56a45bdefe4d304d991d53083 (diff) | |
download | gcc-f3ffec8eee91e75497006f2d1f4c5a21acdea3d0.zip gcc-f3ffec8eee91e75497006f2d1f4c5a21acdea3d0.tar.gz gcc-f3ffec8eee91e75497006f2d1f4c5a21acdea3d0.tar.bz2 |
tree.c (get_set_constructor_bytes): New function. Replaces ...
(get_set_constructor_words): ... removed old function.
From-SVN: r8952
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -4109,23 +4109,22 @@ get_set_constructor_bits (init, buffer, bit_size) } /* Expand (the constant part of) a SET_TYPE CONTRUCTOR node. - The result is placed in BUFFER (which is an array of WD_SIZE - words). TYPE_ALIGN bits are stored in each element of BUFFER. + 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_words (init, buffer, wd_size) +get_set_constructor_bytes (init, buffer, wd_size) tree init; - HOST_WIDE_INT *buffer; + unsigned char *buffer; int wd_size; { int i; tree vals = TREE_OPERAND (init, 1); - int set_word_size = TYPE_ALIGN (TREE_TYPE (init)); + int set_word_size = BITS_PER_UNIT; int bit_size = wd_size * set_word_size; int bit_pos = 0; - HOST_WIDE_INT *wordp = buffer; + unsigned char *bytep = buffer; char *bit_buffer = (char*)alloca(bit_size); tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size); @@ -4137,13 +4136,13 @@ get_set_constructor_words (init, buffer, wd_size) if (bit_buffer[i]) { if (BITS_BIG_ENDIAN) - *wordp |= (1 << (set_word_size - 1 - bit_pos)); + *bytep |= (1 << (set_word_size - 1 - bit_pos)); else - *wordp |= 1 << bit_pos; + *bytep |= 1 << bit_pos; } bit_pos++; if (bit_pos >= set_word_size) - bit_pos = 0, wordp++; + bit_pos = 0, bytep++; } return non_const_bits; } |