Commit 598a56c0 by Ed Schonberg Committed by Arnaud Charlet

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
parent ee935273
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.
......
......@@ -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))
......
......@@ -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);
......
......@@ -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",
......
......@@ -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 --
----------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment