aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2015-05-22 13:04:01 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 15:04:01 +0200
commit598a56c0966307d662168dd711602d71d0686442 (patch)
treeaf9490147cd33305113f8c7f62a21b6d504f4984
parentee93527368e112d1f2a9b0e739fc513eff3e048e (diff)
downloadgcc-598a56c0966307d662168dd711602d71d0686442.zip
gcc-598a56c0966307d662168dd711602d71d0686442.tar.gz
gcc-598a56c0966307d662168dd711602d71d0686442.tar.bz2
sem_ch10.adb (Analyze_With_Clause): In ASIS_Mode...
2015-05-22 Ed Schonberg <schonberg@adacore.com> * sem_ch10.adb (Analyze_With_Clause): In ASIS_Mode, a limited_with clause on a predefined unit is not transformed into a regular with_clause, to preserve the original tree structure. * sinfo.ads (N_With_Clause): Add comment on handling of Limited_With. * sem_ch10.adb: Minor reformatting. 2015-05-22 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Freeze_Profile): A limited view of a type in the profile of a subprogram renaming does not require freezing, because it is declared in a different unit. 2015-05-22 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Get_Constraint_Association): If type (of ancestor composite type) is private, go to full view. This was previously done only in an instance context, but is happen whenever a chain of private extensions includes one inherited discriminant. From-SVN: r223565
-rw-r--r--gcc/ada/ChangeLog22
-rw-r--r--gcc/ada/exp_aggr.adb13
-rw-r--r--gcc/ada/sem_ch10.adb6
-rw-r--r--gcc/ada/sem_ch8.adb10
-rw-r--r--gcc/ada/sinfo.ads10
5 files changed, 52 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 863e3d9..7482e0c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,25 @@
+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Analyze_With_Clause): In ASIS_Mode, a
+ limited_with clause on a predefined unit is not transformed into
+ a regular with_clause, to preserve the original tree structure.
+ * sinfo.ads (N_With_Clause): Add comment on handling of
+ Limited_With.
+ * sem_ch10.adb: Minor reformatting.
+
+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Freeze_Profile): A limited view of a type in
+ the profile of a subprogram renaming does not require freezing,
+ because it is declared in a different unit.
+
+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Get_Constraint_Association): If type (of ancestor
+ composite type) is private, go to full view. This was previously
+ done only in an instance context, but is happen whenever a chain
+ of private extensions includes one inherited discriminant.
+
2015-05-22 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor comment updates.
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 70f4968..8651074 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -2065,19 +2065,18 @@ package body Exp_Aggr is
begin
Typ := T;
- -- Handle private types in instances
+ -- If type is private, get constraint from full view. This was
+ -- previously done in an instance context, but is needed whenever
+ -- the ancestor part has a discriminant, possibly inherited through
+ -- multiple derivations.
- if In_Instance
- and then Is_Private_Type (Typ)
- and then Present (Full_View (Typ))
- then
+ if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
Typ := Full_View (Typ);
end if;
Indic := Subtype_Indication (Type_Definition (Parent (Typ)));
- -- ??? Also need to cover case of a type mark denoting a subtype
- -- with constraint.
+ -- Verify that the subtype indication carries a constraint
if Nkind (Indic) = N_Subtype_Indication
and then Present (Constraint (Indic))
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 5824154..55456e6 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -2560,6 +2560,12 @@ package body Sem_Ch10 is
if Sloc (U) /= No_Location then
if Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (U)))
+
+ -- In ASIS mode the rtsfind mechanism plays no role, and
+ -- we need to maintain the original tree structure, so
+ -- this transformation is not performed in this case.
+
+ and then not ASIS_Mode
then
Set_Limited_Present (N, False);
Analyze_With_Clause (N);
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 6772328..689aa8d 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -2493,8 +2493,7 @@ package body Sem_Ch8 is
end loop;
if Ekind (Formal_Spec) = E_Function
- and then Ekind (Etype (Formal_Spec)) = E_Incomplete_Type
- and then not Is_Tagged_Type (Etype (F))
+ and then not Is_Tagged_Type (Etype (Formal_Spec))
then
Has_Untagged_Inc := True;
end if;
@@ -2514,6 +2513,13 @@ package body Sem_Ch8 is
or else Is_Generic_Type (Root_Type (Etype (F)))
then
null;
+
+ -- A limited view of a type declared elsewhere needs no
+ -- freezing actions.
+
+ elsif From_Limited_With (Etype (F)) then
+ null;
+
else
Error_Msg_NE
("type& must be frozen before this point",
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 5ced356..4af7b54 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -521,6 +521,9 @@ package Sinfo is
-- simply ignore these nodes, since they are not relevant to the task
-- of back annotating representation information.
+ -- Some other ASIS-specific issues are covered in specific comments in
+ -- sections for particular nodes or flags.
+
----------------
-- Ghost Mode --
----------------
@@ -6384,6 +6387,13 @@ package Sinfo is
-- Similarly, Private_Present is used to support the implementation of
-- Ada 2005 (AI-50262).
+ -- Note: if the WITH clause refers to a standard library unit, then a
+ -- limited with clause is changed into a normal with clause, because we
+ -- are not prepared to deal with limited with in the context of Rtsfind.
+ -- So in this case, the Limited_Present flag will be False in the final
+ -- tree. However, we do NOT do this transformation in ASIS mode, so for
+ -- ASIS the flag will remain set in this situation.
+
----------------------
-- With_Type clause --
----------------------