Commit 14237616 by Arnaud Charlet

[multiple changes]

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

	* prj-nmsc.adb (Check_Interfaces): Report an error when a
	unit from Library_Interface is not a unit of the project.

2012-01-30  Vincent Pucci  <pucci@adacore.com>

	* sem_prag.adb (Make_Aspect_For_PPC_In_Gen_Sub_Decl): Parent
	links fixed inside PPC pragmas.
	* sem_ch12.adb: Move call to Make_Aspect_For_PPC_In_Gen_Sub_Decl.

2012-01-30  Thomas Quinot  <quinot@adacore.com>

	* s-ransee.ads: Minor reformatting.

From-SVN: r183705
parent de6e4fc4
2012-01-30 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Check_Interfaces): Report an error when a
unit from Library_Interface is not a unit of the project.
2012-01-30 Vincent Pucci <pucci@adacore.com>
* sem_prag.adb (Make_Aspect_For_PPC_In_Gen_Sub_Decl): Parent
links fixed inside PPC pragmas.
* sem_ch12.adb: Move call to Make_Aspect_For_PPC_In_Gen_Sub_Decl.
2012-01-30 Thomas Quinot <quinot@adacore.com>
* s-ransee.ads: Minor reformatting.
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 * prj.ads, prj.adb (For_Each_Source): Add support for skipping
......
...@@ -2556,6 +2556,8 @@ package body Prj.Nmsc is ...@@ -2556,6 +2556,8 @@ package body Prj.Nmsc is
Interface_ALIs : String_List_Id := Nil_String; Interface_ALIs : String_List_Id := Nil_String;
Unit_Found : Boolean;
begin begin
if not Interfaces.Default then if not Interfaces.Default then
...@@ -2583,7 +2585,15 @@ package body Prj.Nmsc is ...@@ -2583,7 +2585,15 @@ package body Prj.Nmsc is
Project_2 := Project; Project_2 := Project;
Big_Loop : Big_Loop :
while Project_2 /= No_Project loop while Project_2 /= No_Project loop
Iter := For_Each_Source (Data.Tree, Project_2); if Project.Qualifier = Aggregate_Library then
-- For an aggregate library we want to consider sources of
-- all aggregated projects.
Iter := For_Each_Source (Data.Tree);
else
Iter := For_Each_Source (Data.Tree, Project_2);
end if;
loop loop
Source := Prj.Element (Iter); Source := Prj.Element (Iter);
...@@ -2680,11 +2690,20 @@ package body Prj.Nmsc is ...@@ -2680,11 +2690,20 @@ package body Prj.Nmsc is
Get_Name_String (Element.Value); Get_Name_String (Element.Value);
To_Lower (Name_Buffer (1 .. Name_Len)); To_Lower (Name_Buffer (1 .. Name_Len));
Name := Name_Find; Name := Name_Find;
Unit_Found := False;
Project_2 := Project; Project_2 := Project;
Big_Loop_2 : Big_Loop_2 :
while Project_2 /= No_Project loop while Project_2 /= No_Project loop
Iter := For_Each_Source (Data.Tree, Project_2); if Project.Qualifier = Aggregate_Library then
-- For an aggregate library we want to consider sources of
-- all aggregated projects.
Iter := For_Each_Source (Data.Tree);
else
Iter := For_Each_Source (Data.Tree, Project_2);
end if;
loop loop
Source := Prj.Element (Iter); Source := Prj.Element (Iter);
...@@ -2731,6 +2750,7 @@ package body Prj.Nmsc is ...@@ -2731,6 +2750,7 @@ package body Prj.Nmsc is
String_Element_Table.Last (Shared.String_Elements); String_Element_Table.Last (Shared.String_Elements);
end if; end if;
Unit_Found := True;
exit Big_Loop_2; exit Big_Loop_2;
end if; end if;
...@@ -2740,6 +2760,15 @@ package body Prj.Nmsc is ...@@ -2740,6 +2760,15 @@ package body Prj.Nmsc is
Project_2 := Project_2.Extends; Project_2 := Project_2.Extends;
end loop Big_Loop_2; end loop Big_Loop_2;
if not Unit_Found then
Error_Msg_Name_1 := Name_Id (Name);
Error_Msg
(Data.Flags,
"%% is not a unit of this project",
Element.Location, Project);
end if;
List := Element.Next; List := Element.Next;
end loop; end loop;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2011, Free Software Foundation, Inc. -- -- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
-- o one based on Ada.Calendar -- o one based on Ada.Calendar
-- o one based on Ada.Real_Time -- o one based on Ada.Real_Time
-- This is required because Ada.Calendar cannot be used on ravenscar, but -- This is required because Ada.Calendar cannot be used on Ravenscar, but
-- Ada.Real_Time drags in the whole tasking runtime on regular platforms. -- Ada.Real_Time drags in the whole tasking runtime on regular platforms.
package System.Random_Seed is package System.Random_Seed is
......
...@@ -3112,15 +3112,6 @@ package body Sem_Ch12 is ...@@ -3112,15 +3112,6 @@ package body Sem_Ch12 is
end; end;
end if; end if;
-- For ASIS purposes, convert any postcondition, precondition pragmas
-- into aspects, if N is not a compilation unit by itself, in order to
-- enable the analysis of expressions inside the corresponding PPC
-- pragmas.
if ASIS_Mode and then Is_List_Member (N) then
Make_Aspect_For_PPC_In_Gen_Sub_Decl (N);
end if;
Spec := Specification (N); Spec := Specification (N);
Id := Defining_Entity (Spec); Id := Defining_Entity (Spec);
Generate_Definition (Id); Generate_Definition (Id);
...@@ -3216,6 +3207,15 @@ package body Sem_Ch12 is ...@@ -3216,6 +3207,15 @@ package body Sem_Ch12 is
Save_Global_References (Original_Node (N)); Save_Global_References (Original_Node (N));
-- For ASIS purposes, convert any postcondition, precondition pragmas
-- into aspects, if N is not a compilation unit by itself, in order to
-- enable the analysis of expressions inside the corresponding PPC
-- pragmas.
if ASIS_Mode and then Is_List_Member (N) then
Make_Aspect_For_PPC_In_Gen_Sub_Decl (N);
end if;
-- To capture global references, analyze the expressions of aspects, -- To capture global references, analyze the expressions of aspects,
-- and propagate information to original tree. Note that in this case -- and propagate information to original tree. Note that in this case
-- analysis of attributes is not delayed until the freeze point. -- analysis of attributes is not delayed until the freeze point.
......
...@@ -15286,7 +15286,6 @@ package body Sem_Prag is ...@@ -15286,7 +15286,6 @@ package body Sem_Prag is
Aspects : constant List_Id := New_List; Aspects : constant List_Id := New_List;
Loc : constant Source_Ptr := Sloc (Decl); Loc : constant Source_Ptr := Sloc (Decl);
Or_Decl : constant Node_Id := Original_Node (Decl); Or_Decl : constant Node_Id := Original_Node (Decl);
Aspect : Node_Id;
Original_Aspects : List_Id; Original_Aspects : List_Id;
-- To capture global references, a copy of the created aspects must be -- To capture global references, a copy of the created aspects must be
...@@ -15309,16 +15308,19 @@ package body Sem_Prag is ...@@ -15309,16 +15308,19 @@ package body Sem_Prag is
-- Make an aspect from any PPC pragma -- Make an aspect from any PPC pragma
Aspect := Append (
Make_Aspect_Specification (Loc, Make_Aspect_Specification (Loc,
Identifier => Identifier =>
Make_Identifier (Loc, Chars (Pragma_Identifier (Prag))), Make_Identifier (Loc, Chars (Pragma_Identifier (Prag))),
Expression => Expression (Prag_Arg_Ass)); Expression =>
Copy_Separate_Tree (Expression (Prag_Arg_Ass))),
Aspects);
Append (Aspect, Aspects); -- Generate the analysis information in the pragma expression
-- and then set the pragma node analyzed to avoid any further
-- Set the pragma node analyzed to avoid any further analysis -- analysis.
Analyze (Expression (Prag_Arg_Ass));
Set_Analyzed (Prag, True); Set_Analyzed (Prag, True);
when others => null; when others => null;
......
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