This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
MInor update to stor-layout.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: MInor update to stor-layout.c
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Tue, 25 Apr 00 08:28:04 EDT
This cleans up finalize_record_size a bit and makes compute_record_mode
non-static (the Ada front end has a good use for it).
Tue Apr 25 07:33:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c (finalize_record_size): Simplify to use existing
functions.
(compute_record_mode): No longer static.
* tree.h (compute_record_mode): New declaration.
*** stor-layout.c 2000/04/21 19:19:24 1.68
--- stor-layout.c 2000/04/25 10:54:19
*************** unsigned int set_alignment = 0;
*** 52,56 ****
static void finalize_record_size PARAMS ((record_layout_info));
- static void compute_record_mode PARAMS ((tree));
static void finalize_type_size PARAMS ((tree));
static void place_union_field PARAMS ((record_layout_info, tree));
--- 52,55 ----
*************** finalize_record_size (rli)
*** 891,901 ****
tree unpadded_size, unpadded_size_unit;
! /* Next move any full bytes of bits into the byte size. */
! rli->offset
! = size_binop (PLUS_EXPR, rli->offset,
! convert (sizetype,
! size_binop (TRUNC_DIV_EXPR, rli->bitpos,
! bitsize_unit_node)));
! rli->bitpos = size_binop (TRUNC_MOD_EXPR, rli->bitpos, bitsize_unit_node);
/* Determine the desired alignment. */
--- 890,897 ----
tree unpadded_size, unpadded_size_unit;
! /* Now we want just byte and bit offsets, so set the offset alignment
! to be a byte and then normalize. */
! rli->offset_align = BITS_PER_UNIT;
! normalize_rli (rli);
/* Determine the desired alignment. */
*************** finalize_record_size (rli)
*** 907,920 ****
#endif
! unpadded_size
! = size_binop (PLUS_EXPR, rli->bitpos,
! size_binop (MULT_EXPR, convert (bitsizetype, rli->offset),
! bitsize_unit_node));
!
! unpadded_size_unit
! = size_binop (PLUS_EXPR, rli->offset,
! convert (sizetype,
! size_binop (CEIL_DIV_EXPR, rli->bitpos,
! bitsize_unit_node)));
/* Record the un-rounded size in the binfo node. But first we check
--- 903,914 ----
#endif
! /* Compute the size so far. Be sure to allow for extra bits in the
! size in bytes. We have guaranteed above that it will be no more
! than a single byte. */
! unpadded_size = rli_size_so_far (rli);
! unpadded_size_unit = rli_size_unit_so_far (rli);
! if (! integer_zerop (rli->bitpos))
! unpadded_size_unit
! = size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
/* Record the un-rounded size in the binfo node. But first we check
*************** finalize_record_size (rli)
*** 994,998 ****
/* Compute the TYPE_MODE for the TYPE (which is a RECORD_TYPE). */
! static void
compute_record_mode (type)
tree type;
--- 988,992 ----
/* Compute the TYPE_MODE for the TYPE (which is a RECORD_TYPE). */
! void
compute_record_mode (type)
tree type;
*** tree.h 2000/04/24 16:17:03 1.162
--- tree.h 2000/04/25 10:54:50
*************** extern tree rli_size_so_far PARAMS ((re
*** 1801,1804 ****
--- 1801,1805 ----
extern void normalize_rli PARAMS ((record_layout_info));
extern void place_field PARAMS ((record_layout_info, tree));
+ extern void compute_record_mode PARAMS ((tree));
extern void finish_record_layout PARAMS ((record_layout_info));