Commit 757240b3 by Arnaud Charlet

[multiple changes]

2009-04-24  Emmanuel Briot  <briot@adacore.com>

	* prj.ads, prj-nmsc.adb (Unit_Project): removed, since in fact we were
	only ever using the Project field.

2009-04-24  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): Do not set
	Body_Required on the generated compilation node. The new node is linked
	to its body, but both share the same file, so we do not set this flag
	on the new unit so as not to create a spurious dependency on a
	non-existent body in the ali file for the instance.

2009-04-24  Robert Dewar  <dewar@adacore.com>

	* make.adb: Minor reformatting

From-SVN: r146725
parent aca53298
2009-04-24 Emmanuel Briot <briot@adacore.com> 2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj.ads, prj-nmsc.adb (Unit_Project): removed, since in fact we were
only ever using the Project field.
2009-04-24 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): Do not set
Body_Required on the generated compilation node. The new node is linked
to its body, but both share the same file, so we do not set this flag
on the new unit so as not to create a spurious dependency on a
non-existent body in the ali file for the instance.
2009-04-24 Robert Dewar <dewar@adacore.com>
* make.adb: Minor reformatting
2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj.adb, prj.ads, prj-nmsc.adb (Check_File, Record_Ada_Source, * prj.adb, prj.ads, prj-nmsc.adb (Check_File, Record_Ada_Source,
Add_Source): merge some code between those. In particular change where Add_Source): merge some code between those. In particular change where
file normalization is done to avoid a few extra calls to file normalization is done to avoid a few extra calls to
......
...@@ -6574,9 +6574,10 @@ package body Make is ...@@ -6574,9 +6574,10 @@ package body Make is
declare declare
Dir_Path : constant String := Dir_Path : constant String :=
Get_Name_String Get_Name_String
(Project_Tree.Projects.Table (Project_Tree.Projects.Table
(Main_Project).Directory.Name); (Main_Project).Directory.Name);
begin begin
for for
J in Last_Binder_Switch + 1 .. Binder_Switches.Last J in Last_Binder_Switch + 1 .. Binder_Switches.Last
......
...@@ -1406,17 +1406,10 @@ package Prj is ...@@ -1406,17 +1406,10 @@ package Prj is
Equal => "="); Equal => "=");
-- Mapping of unit names to indexes in the Units table -- Mapping of unit names to indexes in the Units table
type Unit_Project is record
Unit : Unit_Index := No_Unit_Index;
Project : Project_Id := No_Project;
end record;
No_Unit_Project : constant Unit_Project := (No_Unit_Index, No_Project);
package Files_Htable is new Simple_HTable package Files_Htable is new Simple_HTable
(Header_Num => Header_Num, (Header_Num => Header_Num,
Element => Unit_Project, Element => Project_Id,
No_Element => No_Unit_Project, No_Element => No_Project,
Key => File_Name_Type, Key => File_Name_Type,
Hash => Hash, Hash => Hash,
Equal => "="); Equal => "=");
......
...@@ -885,10 +885,13 @@ package body Sem_Ch12 is ...@@ -885,10 +885,13 @@ package body Sem_Ch12 is
Formals : List_Id; Formals : List_Id;
F_Copy : List_Id) return List_Id F_Copy : List_Id) return List_Id
is is
Actual_Types : constant Elist_Id := New_Elmt_List;
Assoc : constant List_Id := New_List; Actual_Types : constant Elist_Id := New_Elmt_List;
Assoc : constant List_Id := New_List;
Default_Actuals : constant Elist_Id := New_Elmt_List; Default_Actuals : constant Elist_Id := New_Elmt_List;
Gen_Unit : constant Entity_Id := Defining_Entity (Parent (F_Copy)); Gen_Unit : constant Entity_Id
:= Defining_Entity (Parent (F_Copy));
Actuals : List_Id; Actuals : List_Id;
Actual : Node_Id; Actual : Node_Id;
Formal : Node_Id; Formal : Node_Id;
...@@ -905,16 +908,16 @@ package body Sem_Ch12 is ...@@ -905,16 +908,16 @@ package body Sem_Ch12 is
-- individual defaults for each such formal. These defaults are -- individual defaults for each such formal. These defaults are
-- appended to the list of associations and replace the Others_Choice. -- appended to the list of associations and replace the Others_Choice.
Found_Assoc : Node_Id; Found_Assoc : Node_Id;
-- Association for the current formal being match. Empty if there are -- Association for the current formal being match. Empty if there are
-- no remaining actuals, or if there is no named association with the -- no remaining actuals, or if there is no named association with the
-- name of the formal. -- name of the formal.
Is_Named_Assoc : Boolean; Is_Named_Assoc : Boolean;
Num_Matched : Int := 0; Num_Matched : Int := 0;
Num_Actuals : Int := 0; Num_Actuals : Int := 0;
Others_Present : Boolean := False; Others_Present : Boolean := False;
-- In Ada 2005, indicates partial parametrization of a formal -- In Ada 2005, indicates partial parametrization of a formal
-- package. As usual an other association must be last in the list. -- package. As usual an other association must be last in the list.
...@@ -1047,7 +1050,6 @@ package body Sem_Ch12 is ...@@ -1047,7 +1050,6 @@ package body Sem_Ch12 is
procedure Process_Default (F : Entity_Id) is procedure Process_Default (F : Entity_Id) is
Loc : constant Source_Ptr := Sloc (I_Node); Loc : constant Source_Ptr := Sloc (I_Node);
F_Id : constant Entity_Id := Defining_Entity (F); F_Id : constant Entity_Id := Defining_Entity (F);
Decl : Node_Id; Decl : Node_Id;
Default : Node_Id; Default : Node_Id;
Id : Entity_Id; Id : Entity_Id;
...@@ -1132,7 +1134,7 @@ package body Sem_Ch12 is ...@@ -1132,7 +1134,7 @@ package body Sem_Ch12 is
if Present (Actuals) then if Present (Actuals) then
-- check for an Others choice, indicating a partial parametrization -- Check for an Others choice, indicating a partial parametrization
-- for a formal package. -- for a formal package.
Actual := First (Actuals); Actual := First (Actuals);
...@@ -1292,11 +1294,10 @@ package body Sem_Ch12 is ...@@ -1292,11 +1294,10 @@ package body Sem_Ch12 is
Defining_Unit_Name (Specification (Formal)), Defining_Unit_Name (Specification (Formal)),
Defining_Unit_Name (Specification (Analyzed_Formal))); Defining_Unit_Name (Specification (Analyzed_Formal)));
-- If the formal subprogram has the same name as -- If the formal subprogram has the same name as another
-- another formal subprogram of the generic, then -- formal subprogram of the generic, then a named
-- a named association is illegal (12.3(9)). Exclude -- association is illegal (12.3(9)). Exclude named
-- named associations that are generated for a nested -- associations that are generated for a nested instance.
-- instance.
if Present (Match) if Present (Match)
and then Is_Named_Assoc and then Is_Named_Assoc
...@@ -1424,7 +1425,6 @@ package body Sem_Ch12 is ...@@ -1424,7 +1425,6 @@ package body Sem_Ch12 is
declare declare
Elmt : Elmt_Id := First_Elmt (Actual_Types); Elmt : Elmt_Id := First_Elmt (Actual_Types);
begin begin
while Present (Elmt) loop while Present (Elmt) loop
Freeze_Before (I_Node, Node (Elmt)); Freeze_Before (I_Node, Node (Elmt));
...@@ -1934,7 +1934,6 @@ package body Sem_Ch12 is ...@@ -1934,7 +1934,6 @@ package body Sem_Ch12 is
("initialization not allowed for `IN OUT` formals", N); ("initialization not allowed for `IN OUT` formals", N);
end if; end if;
end if; end if;
end Analyze_Formal_Object_Declaration; end Analyze_Formal_Object_Declaration;
---------------------------------------------- ----------------------------------------------
...@@ -1984,7 +1983,7 @@ package body Sem_Ch12 is ...@@ -1984,7 +1983,7 @@ package body Sem_Ch12 is
procedure Analyze_Formal_Package (N : Node_Id) is procedure Analyze_Formal_Package (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N); Loc : constant Source_Ptr := Sloc (N);
Pack_Id : constant Entity_Id := Defining_Identifier (N); Pack_Id : constant Entity_Id := Defining_Identifier (N);
Formal : Entity_Id; Formal : Entity_Id;
Gen_Id : constant Node_Id := Name (N); Gen_Id : constant Node_Id := Name (N);
Gen_Decl : Node_Id; Gen_Decl : Node_Id;
...@@ -2039,6 +2038,7 @@ package body Sem_Ch12 is ...@@ -2039,6 +2038,7 @@ package body Sem_Ch12 is
-- create corresponding declarations for all entities in the formal -- create corresponding declarations for all entities in the formal
-- part, so that names with the proper types are available in the -- part, so that names with the proper types are available in the
-- specification of the formal package. -- specification of the formal package.
-- On the other hand, if there are no associations, then all the -- On the other hand, if there are no associations, then all the
-- formals must have defaults, and this will be checked by the -- formals must have defaults, and this will be checked by the
-- call to Analyze_Associations. -- call to Analyze_Associations.
...@@ -4372,7 +4372,11 @@ package body Sem_Ch12 is ...@@ -4372,7 +4372,11 @@ package body Sem_Ch12 is
Make_Compilation_Unit_Aux (Sloc (N))); Make_Compilation_Unit_Aux (Sloc (N)));
Set_Parent_Spec (Act_Decl, Parent_Spec (N)); Set_Parent_Spec (Act_Decl, Parent_Spec (N));
Set_Body_Required (Decl_Cunit, True);
-- The new compilation unit is linked to its body, but both share the
-- same file, so we do not set Body_Required on the new unit so as not
-- to create a spurious dependency on a non-existent body in the ali.
-- This simplifies codepeer unit traversal.
-- We use the original instantiation compilation unit as the resulting -- We use the original instantiation compilation unit as the resulting
-- compilation unit of the instance, since this is the main unit. -- compilation unit of the instance, since this is the main unit.
......
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