aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2013-01-07 10:39:45 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-01-07 10:39:45 +0000
commita8c4c75a4a5062687fa08d1d6273cef4a0ce22fe (patch)
tree090c47cf2ddadf22ac6c2ce5abed3d927fedc34f /gcc/ada
parent5b638c3a5af30d98009c94fa309beec02e9ba330 (diff)
downloadgcc-a8c4c75a4a5062687fa08d1d6273cef4a0ce22fe.zip
gcc-a8c4c75a4a5062687fa08d1d6273cef4a0ce22fe.tar.gz
gcc-a8c4c75a4a5062687fa08d1d6273cef4a0ce22fe.tar.bz2
decl.c (gnat_to_gnu_entity): Adjust comment about type extension with discriminants.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Adjust comment about type extension with discriminants. <E_Record_Subtype>: Remove useless test and reorder conditions. (elaborate_entity) <E_Record_Subtype>: Likewise. From-SVN: r194965
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/gcc-interface/decl.c13
2 files changed, 12 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c7ee9974..c644b26 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Adjust
+ comment about type extension with discriminants.
+ <E_Record_Subtype>: Remove useless test and reorder conditions.
+ (elaborate_entity) <E_Record_Subtype>: Likewise.
+
2013-01-07 Richard Biener <rguenther@suse.de>
PR ada/864
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 3284f84..d6729f7 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -3006,9 +3006,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
tree gnu_parent;
/* A major complexity here is that the parent subtype will
- reference our discriminants in its Discriminant_Constraint
- list. But those must reference the parent component of this
- record which is of the parent subtype we have not built yet!
+ reference our discriminants in its Stored_Constraint list.
+ But those must reference the parent component of this record
+ which is precisely of the parent subtype we have not built yet!
To break the circle we first build a dummy COMPONENT_REF which
represents the "get to the parent" operation and initialize
each of those discriminants to a COMPONENT_REF of the above
@@ -3287,9 +3287,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (IN (Ekind (gnat_base_type), Record_Kind)
&& !Is_Unchecked_Union (gnat_base_type)
&& !Is_For_Access_Subtype (gnat_entity)
- && Is_Constrained (gnat_entity)
&& Has_Discriminants (gnat_entity)
- && Present (Discriminant_Constraint (gnat_entity))
+ && Is_Constrained (gnat_entity)
&& Stored_Constraint (gnat_entity) != No_Elist)
{
vec<subst_pair> gnu_subst_list
@@ -5948,9 +5947,7 @@ elaborate_entity (Entity_Id gnat_entity)
case E_Private_Subtype:
case E_Limited_Private_Subtype:
case E_Record_Subtype_With_Private:
- if (Is_Constrained (gnat_entity)
- && Has_Discriminants (gnat_entity)
- && Present (Discriminant_Constraint (gnat_entity)))
+ if (Has_Discriminants (gnat_entity) && Is_Constrained (gnat_entity))
{
Node_Id gnat_discriminant_expr;
Entity_Id gnat_field;