Commit 80eaf415 by Andreas Jaeger

tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.

	* doc/tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and
	ROUND_TYPE_SIZE_UNIT.

	* stor-layout.c (finalize_record_size): Remove usages of
	ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
	(finalize_type_size): Likewise.
	(layout_type): Likewise.

	* system.h: Poison ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.

ada:
	* utils.c (finish_record_type): Remove usages of
	ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.

From-SVN: r67313
parent e0945432
2003-06-01 Andreas Jaeger <aj@suse.de>
* utils.c (finish_record_type): Remove usages of ROUND_TYPE_SIZE
and ROUND_TYPE_SIZE_UNIT.
2003-05-22 Geert Bosch <bosch@gnat.com> 2003-05-22 Geert Bosch <bosch@gnat.com>
* gnat_rm.texi : Remove reference to Ada Core Technologies. * gnat_rm.texi : Remove reference to Ada Core Technologies.
......
...@@ -847,14 +847,8 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug) ...@@ -847,14 +847,8 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug)
&& ! TYPE_CONTAINS_TEMPLATE_P (record_type)) && ! TYPE_CONTAINS_TEMPLATE_P (record_type))
SET_TYPE_ADA_SIZE (record_type, ada_size); SET_TYPE_ADA_SIZE (record_type, ada_size);
#ifdef ROUND_TYPE_SIZE
size = ROUND_TYPE_SIZE (record_type, size, TYPE_ALIGN (record_type));
size_unit = ROUND_TYPE_SIZE_UNIT (record_type, size_unit,
TYPE_ALIGN (record_type) / BITS_PER_UNIT);
#else
size = round_up (size, TYPE_ALIGN (record_type)); size = round_up (size, TYPE_ALIGN (record_type));
size_unit = round_up (size_unit, TYPE_ALIGN (record_type) / BITS_PER_UNIT); size_unit = round_up (size_unit, TYPE_ALIGN (record_type) / BITS_PER_UNIT);
#endif
if (has_rep if (has_rep
&& ! (TREE_CODE (record_type) == RECORD_TYPE && ! (TREE_CODE (record_type) == RECORD_TYPE
......
...@@ -1280,21 +1280,6 @@ Normally, this is not needed. See the file @file{c4x.h} for an example ...@@ -1280,21 +1280,6 @@ Normally, this is not needed. See the file @file{c4x.h} for an example
of how to use this macro to prevent a structure having a floating point of how to use this macro to prevent a structure having a floating point
field from being accessed in an integer mode. field from being accessed in an integer mode.
@findex ROUND_TYPE_SIZE
@item ROUND_TYPE_SIZE (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the overall size of a type
(given by @var{type} as a tree node) when the size computed in the
usual way is @var{computed} and the alignment is @var{specified}.
The default is to round @var{computed} up to a multiple of @var{specified}.
@findex ROUND_TYPE_SIZE_UNIT
@item ROUND_TYPE_SIZE_UNIT (@var{type}, @var{computed}, @var{specified})
Similar to @code{ROUND_TYPE_SIZE}, but sizes and alignments are
specified in units (bytes). If you define @code{ROUND_TYPE_SIZE},
you must also define this macro and they must be defined consistently
with each other.
@findex ROUND_TYPE_ALIGN @findex ROUND_TYPE_ALIGN
@item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified}) @item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the alignment of a type (given Define this macro as an expression for the alignment of a type (given
......
...@@ -1279,17 +1279,9 @@ finalize_record_size (rli) ...@@ -1279,17 +1279,9 @@ finalize_record_size (rli)
= size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node); = size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
/* Round the size up to be a multiple of the required alignment */ /* Round the size up to be a multiple of the required alignment */
#ifdef ROUND_TYPE_SIZE
TYPE_SIZE (rli->t) = ROUND_TYPE_SIZE (rli->t, unpadded_size,
TYPE_ALIGN (rli->t));
TYPE_SIZE_UNIT (rli->t)
= ROUND_TYPE_SIZE_UNIT (rli->t, unpadded_size_unit,
TYPE_ALIGN (rli->t) / BITS_PER_UNIT);
#else
TYPE_SIZE (rli->t) = round_up (unpadded_size, TYPE_ALIGN (rli->t)); TYPE_SIZE (rli->t) = round_up (unpadded_size, TYPE_ALIGN (rli->t));
TYPE_SIZE_UNIT (rli->t) = round_up (unpadded_size_unit, TYPE_SIZE_UNIT (rli->t) = round_up (unpadded_size_unit,
TYPE_ALIGN (rli->t) / BITS_PER_UNIT); TYPE_ALIGN (rli->t) / BITS_PER_UNIT);
#endif
if (warn_padded && TREE_CONSTANT (unpadded_size) if (warn_padded && TREE_CONSTANT (unpadded_size)
&& simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0) && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0)
...@@ -1308,13 +1300,7 @@ finalize_record_size (rli) ...@@ -1308,13 +1300,7 @@ finalize_record_size (rli)
rli->unpacked_align = MAX (TYPE_ALIGN (rli->t), rli->unpacked_align); rli->unpacked_align = MAX (TYPE_ALIGN (rli->t), rli->unpacked_align);
#endif #endif
#ifdef ROUND_TYPE_SIZE
unpacked_size = ROUND_TYPE_SIZE (rli->t, TYPE_SIZE (rli->t),
rli->unpacked_align);
#else
unpacked_size = round_up (TYPE_SIZE (rli->t), rli->unpacked_align); unpacked_size = round_up (TYPE_SIZE (rli->t), rli->unpacked_align);
#endif
if (simple_cst_equal (unpacked_size, TYPE_SIZE (rli->t))) if (simple_cst_equal (unpacked_size, TYPE_SIZE (rli->t)))
{ {
TYPE_PACKED (rli->t) = 0; TYPE_PACKED (rli->t) = 0;
...@@ -1470,17 +1456,9 @@ finalize_type_size (type) ...@@ -1470,17 +1456,9 @@ finalize_type_size (type)
if (TYPE_SIZE (type) != 0) if (TYPE_SIZE (type) != 0)
{ {
#ifdef ROUND_TYPE_SIZE
TYPE_SIZE (type)
= ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
TYPE_SIZE_UNIT (type)
= ROUND_TYPE_SIZE_UNIT (type, TYPE_SIZE_UNIT (type),
TYPE_ALIGN (type) / BITS_PER_UNIT);
#else
TYPE_SIZE (type) = round_up (TYPE_SIZE (type), TYPE_ALIGN (type)); TYPE_SIZE (type) = round_up (TYPE_SIZE (type), TYPE_ALIGN (type));
TYPE_SIZE_UNIT (type) TYPE_SIZE_UNIT (type)
= round_up (TYPE_SIZE_UNIT (type), TYPE_ALIGN (type) / BITS_PER_UNIT); = round_up (TYPE_SIZE_UNIT (type), TYPE_ALIGN (type) / BITS_PER_UNIT);
#endif
} }
/* Evaluate nonconstant sizes only once, either now or as soon as safe. */ /* Evaluate nonconstant sizes only once, either now or as soon as safe. */
...@@ -1779,22 +1757,6 @@ layout_type (type) ...@@ -1779,22 +1757,6 @@ layout_type (type)
TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT); TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT);
#endif #endif
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element); TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element);
#ifdef ROUND_TYPE_SIZE
if (TYPE_SIZE (type) != 0)
{
tree tmp
= ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
/* If the rounding changed the size of the type, remove any
pre-calculated TYPE_SIZE_UNIT. */
if (simple_cst_equal (TYPE_SIZE (type), tmp) != 1)
TYPE_SIZE_UNIT (type) = NULL;
TYPE_SIZE (type) = tmp;
}
#endif
TYPE_MODE (type) = BLKmode; TYPE_MODE (type) = BLKmode;
if (TYPE_SIZE (type) != 0 if (TYPE_SIZE (type) != 0
#ifdef MEMBER_TYPE_FORCES_BLK #ifdef MEMBER_TYPE_FORCES_BLK
......
...@@ -641,7 +641,8 @@ typedef char _Bool; ...@@ -641,7 +641,8 @@ typedef char _Bool;
FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \ FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \
MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP \ MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP \
ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL \ ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL \
OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA ROUND_TYPE_SIZE \
ROUND_TYPE_SIZE_UNIT
/* Hooks that are no longer used. */ /* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
......
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