+2009-01-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Put
+ the _Tag field before any discriminants in the field list.
+ (components_to_record): Remove obsolete comment.
+
2008-12-09 Jakub Jelinek <jakub@redhat.com>
PR ada/38450
= DECL_DISCRIMINANT_NUMBER (gnu_old_field);
TREE_THIS_VOLATILE (gnu_field)
= TREE_THIS_VOLATILE (gnu_old_field);
- TREE_CHAIN (gnu_field) = gnu_field_list;
- gnu_field_list = gnu_field;
+
+ /* To match the layout crafted in components_to_record, if
+ this is the _Tag field, put it before any discriminants
+ instead of after them as for all other fields. */
+ if (Chars (gnat_field) == Name_uTag)
+ gnu_field_list = chainon (gnu_field_list, gnu_field);
+ else
+ {
+ TREE_CHAIN (gnu_field) = gnu_field_list;
+ gnu_field_list = gnu_field;
+ }
+
save_gnu_tree (gnat_field, gnu_field, false);
}
packed, definition);
/* If this is the _Tag field, put it before any discriminants,
- instead of after them as is the case for all other fields.
- Ignore field of void type if only annotating. */
+ instead of after them as is the case for all other fields. */
if (Chars (gnat_field) == Name_uTag)
gnu_field_list = chainon (gnu_field_list, gnu_field);
else