diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-24 11:12:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-24 11:12:21 +0000 |
commit | e99c3ccc40fac2b63c005b2bdc7ef3a18e74cb07 (patch) | |
tree | 718c8faf34e1b5d93a9fcd050d8271216bc9a9b7 /gcc/ada/gcc-interface | |
parent | 2f18d9afae52f1cb10d5cb9e7d1fdbe4dc8710f0 (diff) | |
download | gcc-e99c3ccc40fac2b63c005b2bdc7ef3a18e74cb07.tar.gz |
decl.c (gnat_to_gnu_entity): When processing the parent type...
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When
processing the parent type, build the COMPONENT_REF for a discriminant
with the proper type.
From-SVN: r153528
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d0b52f2e745..6abb366bd07 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -2729,15 +2729,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) Present (gnat_field); gnat_field = Next_Stored_Discriminant (gnat_field)) if (Present (Corresponding_Discriminant (gnat_field))) - save_gnu_tree - (gnat_field, - build3 (COMPONENT_REF, - get_unpadded_type (Etype (gnat_field)), - gnu_get_parent, - gnat_to_gnu_field_decl (Corresponding_Discriminant - (gnat_field)), - NULL_TREE), - true); + { + tree gnu_field + = gnat_to_gnu_field_decl (Corresponding_Discriminant + (gnat_field)); + save_gnu_tree + (gnat_field, + build3 (COMPONENT_REF, TREE_TYPE (gnu_field), + gnu_get_parent, gnu_field, NULL_TREE), + true); + } /* Then we build the parent subtype. If it has discriminants but the type itself has unknown discriminants, this means that it |