summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-11 12:24:02 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-11 12:24:02 +0000
commitc4f4d389030b105b642d790c5f71e8715e334767 (patch)
tree96e350ff0f72e66e9dfa84861b600a114ce233e2 /gcc/ada
parenta32384d7fd4db5621edf60de6b37ae9f4d81a271 (diff)
downloadgcc-c4f4d389030b105b642d790c5f71e8715e334767.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143267 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c17
2 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 166baa82dcd..a8ef574e7f2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 20c5fb4686f..0c7321d07b5 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -3139,8 +3139,18 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= 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);
}
@@ -6436,8 +6446,7 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
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