C++ ABI changes.

* class.c (build_base_field): Set DECL_PACKED.
        (layout_class_type): Don't use tail padding of PODs.
        * mangle.c (write_unqualified_name): Fix template conversion op
        mangling.

From-SVN: r54747
This commit is contained in:
Jason Merrill 2002-06-18 12:05:31 -04:00 committed by Jason Merrill
parent 3831381763
commit 83b14b8847
3 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2002-06-14 Jason Merrill <jason@redhat.com>
C++ ABI changes.
* class.c (build_base_field): Set DECL_PACKED.
(layout_class_type): Don't use tail padding of PODs.
* mangle.c (write_unqualified_name): Fix template conversion op
mangling.
2002-06-16 Richard Henderson <rth@redhat.com>
PR opt/6793

View File

@ -3837,6 +3837,8 @@ build_base_field (rli, binfo, empty_p, offsets, t)
DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype);
DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype);
DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
/* Tell the backend not to round up to TYPE_ALIGN. */
DECL_PACKED (decl) = 1;
if (!integer_zerop (DECL_SIZE (decl)))
{
@ -4978,6 +4980,12 @@ layout_class_type (t, empty_p, vfuns_p,
CLASSTYPE_SIZE (t) = bitsize_zero_node;
CLASSTYPE_SIZE_UNIT (t) = size_zero_node;
}
/* If this is a POD, we can't reuse its tail padding. */
else if (!CLASSTYPE_NON_POD_P (t))
{
CLASSTYPE_SIZE (t) = TYPE_SIZE (t);
CLASSTYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (t);
}
else
{
CLASSTYPE_SIZE (t) = TYPE_BINFO_SIZE (t);

View File

@ -988,8 +988,17 @@ write_unqualified_name (decl)
{
/* Conversion operator. Handle it right here.
<operator> ::= cv <type> */
tree type;
if (decl_is_template_id (decl, NULL))
{
tree fn_type = get_mostly_instantiated_function_type (decl, NULL,
NULL);
type = TREE_TYPE (fn_type);
}
else
type = TREE_TYPE (DECL_NAME (decl));
write_string ("cv");
write_type (TREE_TYPE (DECL_NAME (decl)));
write_type (type);
}
else if (DECL_OVERLOADED_OPERATOR_P (decl))
{