Commit 9328904c by Mark Mitchell Committed by Mark Mitchell

tree.h (record_layout_info_s): New structure.

	* tree.h (record_layout_info_s): New structure.
	(record_layout_info): New type.
	(new_record_layout_info): New function.
	(layout_field): Likewise.
	(finish_record_layout): Likewise.
	* stor-layout.c (layout_record): Remove.
	(new_record_layout_info): New function.
	(layout_field): New function, broken out from layout_record.
	(finalize_record_size): Likewise.
	(compute_record_mode): Likewise.
	(finalize_type_size): New function, broken out from layout_type.
	(finish_record_layout): Likewise.
	(layout_type): Use them.

From-SVN: r32503
parent 05e126b3
2000-03-13 Mark Mitchell <mark@codesourcery.com>
* tree.h (record_layout_info_s): New structure.
(record_layout_info): New type.
(new_record_layout_info): New function.
(layout_field): Likewise.
(finish_record_layout): Likewise.
* stor-layout.c (layout_record): Remove.
(new_record_layout_info): New function.
(layout_field): New function, broken out from layout_record.
(finalize_record_size): Likewise.
(compute_record_mode): Likewise.
(finalize_type_size): New function, broken out from layout_type.
(finish_record_layout): Likewise.
(layout_type): Use them.
2000-03-12 Zack Weinberg <zack@wolery.cumb.org> 2000-03-12 Zack Weinberg <zack@wolery.cumb.org>
* cpphash.c: Don't include version.h. * cpphash.c: Don't include version.h.
......
...@@ -1776,12 +1776,46 @@ extern tree build_qualified_type PARAMS ((tree, int)); ...@@ -1776,12 +1776,46 @@ extern tree build_qualified_type PARAMS ((tree, int));
extern tree build_type_copy PARAMS ((tree)); extern tree build_type_copy PARAMS ((tree));
/* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT, /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
TYPE_ALIGN and TYPE_MODE fields. TYPE_ALIGN and TYPE_MODE fields. If called more than once on one
If called more than once on one node, does nothing except node, does nothing except for the first time. */
for the first time. */
extern void layout_type PARAMS ((tree)); extern void layout_type PARAMS ((tree));
/* These functions allow a front-end to perform a manual layout of a
RECORD_TYPE. (For instance, if the placement of subsequent fields
depends on the placement of fields so far.) Begin by calling
new_record_layout_info. Then, call layout_field for each of the
fields. Then, call finish_record_layout. See layout_type for the
default way in which these functions are used. */
struct record_layout_info_s
{
/* The RECORD_TYPE that we are laying out. */
tree t;
/* The size of the record so far, in bits. */
unsigned HOST_WIDE_INT const_size;
/* The alignment of the record so far, in bits. */
unsigned int record_align;
/* If the record can have a variable size, then this will be
non-NULL, and the total size will be CONST_SIZE + VAR_SIZE. */
tree var_size;
/* If the record can have a variable size, then this will be the
maximum alignment that we know VAR_SIZE has. */
unsigned int var_align;
/* The static variables (i.e., class variables, as opposed to
instance variables) encountered in T. */
tree pending_statics;
unsigned int unpacked_align;
int packed_maybe_necessary;
};
typedef struct record_layout_info_s *record_layout_info;
extern record_layout_info new_record_layout_info
PARAMS ((tree));
extern void layout_field PARAMS ((record_layout_info, tree));
extern void finish_record_layout PARAMS ((record_layout_info));
/* Given a hashcode and a ..._TYPE node (for which the hashcode was made), /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
return a canonicalized ..._TYPE node, so that duplicates are not made. return a canonicalized ..._TYPE node, so that duplicates are not made.
How the hash code is computed is up to the caller, as long as any two How the hash code is computed is up to the caller, as long as any two
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment