Commit de6e4fc4 by Arnaud Charlet

[multiple changes]

2012-01-30  Pascal Obry  <obry@adacore.com>

	* prj.ads, prj.adb (For_Each_Source): Add support for skipping
	sources coming from an encapsulated library.

2012-01-30  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Process-Full_View): fix typo.
	* sem_ch13.adb (Aalyze_Aspect_Specifications): if predicates
	appear on a private type and the full view is available, ensure
	existence of freeze node for full view.
	(Build_Predicate_Function): Attach predicate function to both
	views of a private type.

2012-01-30  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb (Check_Interfaces): Compute the Lib_Interface_ALIs
	for the project if either attribute Library_Interface or
	Interfaces is declared.
	(Check_Stand_Alone_Library): Use Lib_Interface_ALIs computed in
	Check_Interfaces.

From-SVN: r183704
parent a76b09dc
2012-01-30 Pascal Obry <obry@adacore.com> 2012-01-30 Pascal Obry <obry@adacore.com>
* prj.ads, prj.adb (For_Each_Source): Add support for skipping
sources coming from an encapsulated library.
2012-01-30 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Process-Full_View): fix typo.
* sem_ch13.adb (Aalyze_Aspect_Specifications): if predicates
appear on a private type and the full view is available, ensure
existence of freeze node for full view.
(Build_Predicate_Function): Attach predicate function to both
views of a private type.
2012-01-30 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Check_Interfaces): Compute the Lib_Interface_ALIs
for the project if either attribute Library_Interface or
Interfaces is declared.
(Check_Stand_Alone_Library): Use Lib_Interface_ALIs computed in
Check_Interfaces.
2012-01-30 Pascal Obry <obry@adacore.com>
* prj-proc.adb (Recursive_Process): Set From_Encapsulated_Lib * prj-proc.adb (Recursive_Process): Set From_Encapsulated_Lib
boolean value to true in the process list created by this routine. boolean value to true in the process list created by this routine.
* prj.ads (Project_List_Element): New field From_Encapsulated_Lib. * prj.ads (Project_List_Element): New field From_Encapsulated_Lib.
......
...@@ -443,7 +443,13 @@ package body Prj is ...@@ -443,7 +443,13 @@ package body Prj is
if Iter.Language = No_Language_Index then if Iter.Language = No_Language_Index then
if Iter.All_Projects then if Iter.All_Projects then
Iter.Project := Iter.Project.Next; loop
Iter.Project := Iter.Project.Next;
exit when Iter.Project = null
or else Iter.Encapsulated_Libs
or else not Iter.Project.From_Encapsulated_Lib;
end loop;
Project_Changed (Iter); Project_Changed (Iter);
else else
Iter.Project := null; Iter.Project := null;
...@@ -464,19 +470,21 @@ package body Prj is ...@@ -464,19 +470,21 @@ package body Prj is
--------------------- ---------------------
function For_Each_Source function For_Each_Source
(In_Tree : Project_Tree_Ref; (In_Tree : Project_Tree_Ref;
Project : Project_Id := No_Project; Project : Project_Id := No_Project;
Language : Name_Id := No_Name) return Source_Iterator Language : Name_Id := No_Name;
Encapsulated_Libs : Boolean := True) return Source_Iterator
is is
Iter : Source_Iterator; Iter : Source_Iterator;
begin begin
Iter := Source_Iterator' Iter := Source_Iterator'
(In_Tree => In_Tree, (In_Tree => In_Tree,
Project => In_Tree.Projects, Project => In_Tree.Projects,
All_Projects => Project = No_Project, All_Projects => Project = No_Project,
Language_Name => Language, Language_Name => Language,
Language => No_Language_Index, Language => No_Language_Index,
Current => No_Source); Current => No_Source,
Encapsulated_Libs => Encapsulated_Libs);
if Project /= null then if Project /= null then
while Iter.Project /= null while Iter.Project /= null
...@@ -484,6 +492,13 @@ package body Prj is ...@@ -484,6 +492,13 @@ package body Prj is
loop loop
Iter.Project := Iter.Project.Next; Iter.Project := Iter.Project.Next;
end loop; end loop;
else
while not Iter.Encapsulated_Libs
and then Iter.Project.From_Encapsulated_Lib
loop
Iter.Project := Iter.Project.Next;
end loop;
end if; end if;
Project_Changed (Iter); Project_Changed (Iter);
......
...@@ -1180,7 +1180,8 @@ package Prj is ...@@ -1180,7 +1180,8 @@ package Prj is
-- True for virtual extending projects -- True for virtual extending projects
Location : Source_Ptr := No_Location; Location : Source_Ptr := No_Location;
-- The location in the project file source of the reserved word project -- The location in the project file source of the project name that
-- immediately follows the reserved word "project".
--------------- ---------------
-- Languages -- -- Languages --
...@@ -1405,11 +1406,13 @@ package Prj is ...@@ -1405,11 +1406,13 @@ package Prj is
type Source_Iterator is private; type Source_Iterator is private;
function For_Each_Source function For_Each_Source
(In_Tree : Project_Tree_Ref; (In_Tree : Project_Tree_Ref;
Project : Project_Id := No_Project; Project : Project_Id := No_Project;
Language : Name_Id := No_Name) return Source_Iterator; Language : Name_Id := No_Name;
Encapsulated_Libs : Boolean := True) return Source_Iterator;
-- Returns an iterator for all the sources of a project tree, or a specific -- Returns an iterator for all the sources of a project tree, or a specific
-- project, or a specific language. -- project, or a specific language. Include sources from aggregated libs if
-- Aggregated_Libs is True.
function Element (Iter : Source_Iterator) return Source_Id; function Element (Iter : Source_Iterator) return Source_Id;
-- Return the current source (or No_Source if there are no more sources) -- Return the current source (or No_Source if there are no more sources)
...@@ -1847,7 +1850,10 @@ private ...@@ -1847,7 +1850,10 @@ private
Language_Name : Name_Id; Language_Name : Name_Id;
-- Only sources of this language will be returned (or all if No_Name) -- Only sources of this language will be returned (or all if No_Name)
Current : Source_Id; Current : Source_Id;
Encapsulated_Libs : Boolean;
-- True if we want to include the sources from encapsulated libs
end record; end record;
procedure Add_To_Buffer procedure Add_To_Buffer
......
...@@ -1423,6 +1423,9 @@ package body Sem_Ch13 is ...@@ -1423,6 +1423,9 @@ package body Sem_Ch13 is
-- Make sure we have a freeze node (it might otherwise be -- Make sure we have a freeze node (it might otherwise be
-- missing in cases like subtype X is Y, and we would not -- missing in cases like subtype X is Y, and we would not
-- have a place to build the predicate function). -- have a place to build the predicate function).
-- If the type is private, indicate that its completion
-- has a freeze node, because that is the one that will be
-- visible at freeze time.
Set_Has_Predicates (E); Set_Has_Predicates (E);
...@@ -1431,6 +1434,7 @@ package body Sem_Ch13 is ...@@ -1431,6 +1434,7 @@ package body Sem_Ch13 is
then then
Set_Has_Predicates (Full_View (E)); Set_Has_Predicates (Full_View (E));
Set_Has_Delayed_Aspects (Full_View (E)); Set_Has_Delayed_Aspects (Full_View (E));
Ensure_Freeze_Node (Full_View (E));
end if; end if;
Ensure_Freeze_Node (E); Ensure_Freeze_Node (E);
...@@ -5056,6 +5060,14 @@ package body Sem_Ch13 is ...@@ -5056,6 +5060,14 @@ package body Sem_Ch13 is
Set_Has_Predicates (SId); Set_Has_Predicates (SId);
Set_Predicate_Function (Typ, SId); Set_Predicate_Function (Typ, SId);
-- The predicate function is shared between views of a type.
if Is_Private_Type (Typ)
and then Present (Full_View (Typ))
then
Set_Predicate_Function (Full_View (Typ), SId);
end if;
Spec := Spec :=
Make_Function_Specification (Loc, Make_Function_Specification (Loc,
Defining_Unit_Name => SId, Defining_Unit_Name => SId,
......
...@@ -18180,7 +18180,7 @@ package body Sem_Ch3 is ...@@ -18180,7 +18180,7 @@ package body Sem_Ch3 is
if Has_Predicates (Priv_T) then if Has_Predicates (Priv_T) then
Set_Predicate_Function (Priv_T, Predicate_Function (Full_T)); Set_Predicate_Function (Priv_T, Predicate_Function (Full_T));
Set_Has_Predicates (Priv_T); Set_Has_Predicates (Full_T);
end if; end if;
end Process_Full_View; end Process_Full_View;
......
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