Commit 5969611f by Robert Dewar Committed by Arnaud Charlet

exp_ch7.adb, [...]: Minor reformatting.

2011-08-04  Robert Dewar  <dewar@adacore.com>

	* exp_ch7.adb, make.adb, sem_ch10.adb, bindgen.adb, sem_res.adb,
	exp_ch4.adb, makeutl.adb: Minor reformatting.

From-SVN: r177365
parent 6367dd30
2011-08-04 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, make.adb, sem_ch10.adb, bindgen.adb, sem_res.adb,
exp_ch4.adb, makeutl.adb: Minor reformatting.
2011-08-04 Emmanuel Briot <briot@adacore.com> 2011-08-04 Emmanuel Briot <briot@adacore.com>
* make.adb, makeutl.adb, makeutl.ads (Make): major refactoring. * make.adb, makeutl.adb, makeutl.ads (Make): major refactoring.
......
...@@ -1665,6 +1665,10 @@ package body Bindgen is ...@@ -1665,6 +1665,10 @@ package body Bindgen is
procedure Gen_Header; procedure Gen_Header;
-- Generate the header of the finalization routine -- Generate the header of the finalization routine
----------------
-- Gen_Header --
----------------
procedure Gen_Header is procedure Gen_Header is
begin begin
WBI (" procedure finalize_library is"); WBI (" procedure finalize_library is");
...@@ -1685,6 +1689,8 @@ package body Bindgen is ...@@ -1685,6 +1689,8 @@ package body Bindgen is
WBI (" begin"); WBI (" begin");
end Gen_Header; end Gen_Header;
-- Start of processing for Gen_Finalize_Library_Ada
begin begin
for E in reverse Elab_Order.First .. Elab_Order.Last loop for E in reverse Elab_Order.First .. Elab_Order.Last loop
Unum := Elab_Order.Table (E); Unum := Elab_Order.Table (E);
...@@ -1954,7 +1960,7 @@ package body Bindgen is ...@@ -1954,7 +1960,7 @@ package body Bindgen is
if U.Unit_Kind /= 'p' or else U.Is_Generic then if U.Unit_Kind /= 'p' or else U.Is_Generic then
null; null;
-- That aren't an interface to a stand alone library -- .. that are not interfaces to a stand alone library
elsif U.SAL_Interface then elsif U.SAL_Interface then
null; null;
......
...@@ -456,7 +456,7 @@ package body Exp_Ch4 is ...@@ -456,7 +456,7 @@ package body Exp_Ch4 is
then then
declare declare
Pool_Id : constant Entity_Id := Pool_Id : constant Entity_Id :=
Get_Global_Pool_For_Access_Type (Ptr_Typ); Get_Global_Pool_For_Access_Type (Ptr_Typ);
Scop : Node_Id := Cunit_Entity (Current_Sem_Unit); Scop : Node_Id := Cunit_Entity (Current_Sem_Unit);
begin begin
......
...@@ -4078,9 +4078,13 @@ package body Exp_Ch7 is ...@@ -4078,9 +4078,13 @@ package body Exp_Ch7 is
function Get_Global_Pool_For_Access_Type (T : Entity_Id) return Entity_Id is function Get_Global_Pool_For_Access_Type (T : Entity_Id) return Entity_Id is
begin begin
if Opt.True_VMS_Target -- Access types whose size is smaller than System.Address size can
and then Esize (T) = 32 -- exit only on VMS. We can't use the usual global pool which returns
then -- an object of type Address as truncation will make it invalid.
-- To handle this case, VMS has a dedicated global pool that returns
-- addresses that fit into 32 bit accesses.
if Opt.True_VMS_Target and then Esize (T) = 32 then
return RTE (RE_Global_Pool_32_Object); return RTE (RE_Global_Pool_32_Object);
else else
return RTE (RE_Global_Pool_Object); return RTE (RE_Global_Pool_Object);
......
...@@ -612,9 +612,9 @@ package body Make is ...@@ -612,9 +612,9 @@ package body Make is
-- when using project files. -- when using project files.
procedure Queue_Library_Project_Sources; procedure Queue_Library_Project_Sources;
-- For all library project, if the library file does not exist, -- For all library project, if the library file does not exist, put all the
-- put all the project sources in the queue, and flag the project -- project sources in the queue, and flag the project so that the library
-- so that the library is generated. -- is generated.
procedure Compute_Switches_For_Main procedure Compute_Switches_For_Main
(Main_Source_File : in out File_Name_Type; (Main_Source_File : in out File_Name_Type;
...@@ -641,12 +641,15 @@ package body Make is ...@@ -641,12 +641,15 @@ package body Make is
Executable : File_Name_Type := No_File; Executable : File_Name_Type := No_File;
Is_Last_Main : Boolean; Is_Last_Main : Boolean;
Stop_Compile : out Boolean); Stop_Compile : out Boolean);
-- Build all source files for a given main file. -- Build all source files for a given main file
-- Current_Main_Index, if not zero, the index of the current main unit in --
-- its source file. -- Current_Main_Index, if not zero, is the index of the current main unit
-- in its source file.
--
-- Stand_Alone_Libraries is set to True when there are Stand-Alone -- Stand_Alone_Libraries is set to True when there are Stand-Alone
-- Libraries, so that gnatbind is invoked with the -F switch to force -- Libraries, so that gnatbind is invoked with the -F switch to force
-- checking of elaboration flags. -- checking of elaboration flags.
--
-- Stop_Compile is set to true if we should not try to compile any more -- Stop_Compile is set to true if we should not try to compile any more
-- of the main units -- of the main units
...@@ -669,9 +672,8 @@ package body Make is ...@@ -669,9 +672,8 @@ package body Make is
(Non_Std_Executable : Boolean := False; (Non_Std_Executable : Boolean := False;
Executable : File_Name_Type := No_File; Executable : File_Name_Type := No_File;
Main_ALI_File : File_Name_Type); Main_ALI_File : File_Name_Type);
-- Perform the link of a single executable. -- Perform the link of a single executable. The ali file corresponds
-- The ali file corresponding to Main_Source_File. -- to Main_ALI_File. Executable is the file name of an executable.
-- Executable is the file name of an executable.
-- Non_Std_Executable is set to True when there is a possibility that -- Non_Std_Executable is set to True when there is a possibility that
-- the linker will not choose the correct executable file name. -- the linker will not choose the correct executable file name.
...@@ -4172,12 +4174,13 @@ package body Make is ...@@ -4172,12 +4174,13 @@ package body Make is
is is
Linker_Switches_Last : constant Integer := Linker_Switches.Last; Linker_Switches_Last : constant Integer := Linker_Switches.Last;
Path_Option : constant String_Access := Path_Option : constant String_Access :=
MLib.Linker_Library_Path_Option; MLib.Linker_Library_Path_Option;
Libraries_Present : Boolean := False; Libraries_Present : Boolean := False;
Current : Natural; Current : Natural;
Proj2 : Project_Id; Proj2 : Project_Id;
Depth : Natural; Depth : Natural;
Proj1 : Project_List; Proj1 : Project_List;
begin begin
if not Run_Path_Option then if not Run_Path_Option then
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
...@@ -4205,8 +4208,8 @@ package body Make is ...@@ -4205,8 +4208,8 @@ package body Make is
Library_Projs.Increment_Last; Library_Projs.Increment_Last;
Current := Library_Projs.Last; Current := Library_Projs.Last;
-- Any project with a greater depth should be -- Any project with a greater depth should be after this
-- after this project in the list. -- project in the list.
while Current > 1 loop while Current > 1 loop
Proj2 := Library_Projs.Table (Current - 1); Proj2 := Library_Projs.Table (Current - 1);
...@@ -4217,8 +4220,8 @@ package body Make is ...@@ -4217,8 +4220,8 @@ package body Make is
Library_Projs.Table (Current) := Proj1.Project; Library_Projs.Table (Current) := Proj1.Project;
-- If it is not a static library and path option -- If it is not a static library and path option is set, add
-- is set, add it to the Library_Paths table. -- it to the Library_Paths table.
if Proj1.Project.Library_Kind /= Static if Proj1.Project.Library_Kind /= Static
and then Proj1.Project.Extended_By = No_Project and then Proj1.Project.Extended_By = No_Project
...@@ -4280,11 +4283,10 @@ package body Make is ...@@ -4280,11 +4283,10 @@ package body Make is
if Libraries_Present then if Libraries_Present then
-- If Path_Option is not null, create the switch -- If Path_Option is not null, create the switch ("-Wl,-rpath,"
-- ("-Wl,-rpath," or equivalent) with all the non-static -- or equivalent) with all the non-static library dirs plus the
-- library dirs plus the standard GNAT library dir. -- standard GNAT library dir. We do that only if Run_Path_Option
-- We do that only if Run_Path_Option is True -- is True (not disabled by -R switch).
-- (not disabled by -R switch).
if Run_Path_Option and then Path_Option /= null then if Run_Path_Option and then Path_Option /= null then
declare declare
...@@ -4305,8 +4307,7 @@ package body Make is ...@@ -4305,8 +4307,7 @@ package body Make is
Library_Paths.First .. Library_Paths.Last Library_Paths.First .. Library_Paths.Last
loop loop
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
Linker_Switches.Table Linker_Switches.Table (Linker_Switches.Last) :=
(Linker_Switches.Last) :=
new String' new String'
(Path_Option.all & (Path_Option.all &
Library_Paths.Table (Index).all); Library_Paths.Table (Index).all);
...@@ -4315,10 +4316,8 @@ package body Make is ...@@ -4315,10 +4316,8 @@ package body Make is
-- One switch for the standard GNAT library dir -- One switch for the standard GNAT library dir
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
Linker_Switches.Table Linker_Switches.Table (Linker_Switches.Last) :=
(Linker_Switches.Last) := new String'(Path_Option.all & MLib.Utl.Lib_Directory);
new String'
(Path_Option.all & MLib.Utl.Lib_Directory);
else else
-- We are going to create one switch of the form -- We are going to create one switch of the form
...@@ -4327,12 +4326,11 @@ package body Make is ...@@ -4327,12 +4326,11 @@ package body Make is
for Index in for Index in
Library_Paths.First .. Library_Paths.Last Library_Paths.First .. Library_Paths.Last
loop loop
-- Add the length of the library dir plus one -- Add the length of the library dir plus one for the
-- for the directory separator. -- directory separator.
Length := Length :=
Length + Length + Library_Paths.Table (Index)'Length + 1;
Library_Paths.Table (Index)'Length + 1;
end loop; end loop;
-- Finally, add the length of the standard GNAT -- Finally, add the length of the standard GNAT
...@@ -4340,8 +4338,7 @@ package body Make is ...@@ -4340,8 +4338,7 @@ package body Make is
Length := Length + MLib.Utl.Lib_Directory'Length; Length := Length + MLib.Utl.Lib_Directory'Length;
Option := new String (1 .. Length); Option := new String (1 .. Length);
Option (1 .. Path_Option'Length) := Option (1 .. Path_Option'Length) := Path_Option.all;
Path_Option.all;
Current := Path_Option'Length; Current := Path_Option'Length;
-- Put each library dir followed by a dir -- Put each library dir followed by a dir
...@@ -4352,12 +4349,10 @@ package body Make is ...@@ -4352,12 +4349,10 @@ package body Make is
loop loop
Option Option
(Current + 1 .. (Current + 1 ..
Current + Current + Library_Paths.Table (Index)'Length) :=
Library_Paths.Table (Index)'Length) :=
Library_Paths.Table (Index).all; Library_Paths.Table (Index).all;
Current := Current :=
Current + Current + Library_Paths.Table (Index)'Length + 1;
Library_Paths.Table (Index)'Length + 1;
Option (Current) := Path_Separator; Option (Current) := Path_Separator;
end loop; end loop;
...@@ -4371,8 +4366,7 @@ package body Make is ...@@ -4371,8 +4366,7 @@ package body Make is
-- And add the switch to the linker switches -- And add the switch to the linker switches
Linker_Switches.Increment_Last; Linker_Switches.Increment_Last;
Linker_Switches.Table (Linker_Switches.Last) := Linker_Switches.Table (Linker_Switches.Last) := Option;
Option;
end if; end if;
end; end;
end if; end if;
...@@ -4387,8 +4381,8 @@ package body Make is ...@@ -4387,8 +4381,8 @@ package body Make is
Including_Libraries => False, Including_Libraries => False,
Include_Path => False); Include_Path => False);
-- Check for attributes Linker'Linker_Options in projects -- Check for attributes Linker'Linker_Options in projects other than
-- other than the main project -- the main project
declare declare
Linker_Options : constant String_List := Linker_Options : constant String_List :=
...@@ -4416,7 +4410,7 @@ package body Make is ...@@ -4416,7 +4410,7 @@ package body Make is
declare declare
Args : Argument_List Args : Argument_List
(Linker_Switches.First .. Linker_Switches.Last + 2); (Linker_Switches.First .. Linker_Switches.Last + 2);
Last_Arg : Integer := Linker_Switches.First - 1; Last_Arg : Integer := Linker_Switches.First - 1;
Skip : Boolean := False; Skip : Boolean := False;
...@@ -4434,16 +4428,15 @@ package body Make is ...@@ -4434,16 +4428,15 @@ package body Make is
Skip := True; Skip := True;
-- Here we capture and duplicate the linker argument. We -- Here we capture and duplicate the linker argument. We
-- need to do the duplication since the arguments will -- need to do the duplication since the arguments will get
-- get normalized. Not doing so will result in calling -- normalized. Not doing so will result in calling normalized
-- normalized two times for the same set of arguments if -- two times for the same set of arguments if gnatmake is
-- gnatmake is passed multiple mains. This can result in -- passed multiple mains. This can result in the wrong argument
-- the wrong argument being passed to the linker. -- being passed to the linker.
else else
Last_Arg := Last_Arg + 1; Last_Arg := Last_Arg + 1;
Args (Last_Arg) := Args (Last_Arg) := new String'(Linker_Switches.Table (J).all);
new String'(Linker_Switches.Table (J).all);
end if; end if;
end loop; end loop;
...@@ -4468,8 +4461,7 @@ package body Make is ...@@ -4468,8 +4461,7 @@ package body Make is
if Success then if Success then
Successful_Links.Increment_Last; Successful_Links.Increment_Last;
Successful_Links.Table (Successful_Links.Last) := Successful_Links.Table (Successful_Links.Last) := Main_ALI_File;
Main_ALI_File;
elsif Osint.Number_Of_Files = 1 elsif Osint.Number_Of_Files = 1
or else not Keep_Going or else not Keep_Going
...@@ -4485,8 +4477,7 @@ package body Make is ...@@ -4485,8 +4477,7 @@ package body Make is
end if; end if;
Failed_Links.Increment_Last; Failed_Links.Increment_Last;
Failed_Links.Table (Failed_Links.Last) := Failed_Links.Table (Failed_Links.Last) := Main_ALI_File;
Main_ALI_File;
end if; end if;
end; end;
end; end;
...@@ -4500,10 +4491,9 @@ package body Make is ...@@ -4500,10 +4491,9 @@ package body Make is
procedure Binding_Phase procedure Binding_Phase
(Stand_Alone_Libraries : Boolean := False; (Stand_Alone_Libraries : Boolean := False;
Main_ALI_File : File_Name_Type) Main_ALI_File : File_Name_Type)
is is
Args : Argument_List Args : Argument_List (Binder_Switches.First .. Binder_Switches.Last + 2);
(Binder_Switches.First .. Binder_Switches.Last + 2);
-- The arguments for the invocation of gnatbind -- The arguments for the invocation of gnatbind
Last_Arg : Natural := Binder_Switches.Last; Last_Arg : Natural := Binder_Switches.Last;
...@@ -4519,10 +4509,10 @@ package body Make is ...@@ -4519,10 +4509,10 @@ package body Make is
-- The path name of the mapping file -- The path name of the mapping file
begin begin
-- Check if there are shared libraries, so that gnatbind is -- Check if there are shared libraries, so that gnatbind is called with
-- called with -shared. Check also if gnatbind is called with -- -shared. Check also if gnatbind is called with -shared, so that
-- -shared, so that gnatlink is called with -shared-libgcc -- gnatlink is called with -shared-libgcc ensuring that the shared
-- ensuring that the shared version of libgcc will be used. -- version of libgcc will be used.
if Main_Project /= No_Project if Main_Project /= No_Project
and then MLib.Tgt.Support_For_Libraries /= Prj.None and then MLib.Tgt.Support_For_Libraries /= Prj.None
...@@ -4536,6 +4526,7 @@ package body Make is ...@@ -4536,6 +4526,7 @@ package body Make is
Bind_Shared := Shared_Switch'Access; Bind_Shared := Shared_Switch'Access;
exit; exit;
end if; end if;
Proj := Proj.Next; Proj := Proj.Next;
end loop; end loop;
end if; end if;
...@@ -4605,8 +4596,7 @@ package body Make is ...@@ -4605,8 +4596,7 @@ package body Make is
-- Delete the temporary mapping file if one was created -- Delete the temporary mapping file if one was created
if Mapping_Path /= No_Path then if Mapping_Path /= No_Path then
Delete_Temporary_File Delete_Temporary_File (Project_Tree.Shared, Mapping_Path);
(Project_Tree.Shared, Mapping_Path);
end if; end if;
-- And reraise the exception -- And reraise the exception
...@@ -4707,7 +4697,7 @@ package body Make is ...@@ -4707,7 +4697,7 @@ package body Make is
Rebuild : Boolean := False; Rebuild : Boolean := False;
Lib_Timestamp1 : constant Time_Stamp_Type := Lib_Timestamp1 : constant Time_Stamp_Type :=
Proj1.Project.Library_TS; Proj1.Project.Library_TS;
begin begin
List := Proj1.Project.All_Imported_Projects; List := Proj1.Project.All_Imported_Projects;
...@@ -4737,8 +4727,8 @@ package body Make is ...@@ -4737,8 +4727,8 @@ package body Make is
Proj1 := Proj1.Next; Proj1 := Proj1.Next;
end loop; end loop;
-- Reset the flags Need_To_Build_Lib for the next main, -- Reset the flags Need_To_Build_Lib for the next main, to avoid
-- to avoid rebuilding libraries uselessly. -- rebuilding libraries uselessly.
Proj1 := Project_Tree.Projects; Proj1 := Project_Tree.Projects;
while Proj1 /= null loop while Proj1 /= null loop
...@@ -4838,9 +4828,9 @@ package body Make is ...@@ -4838,9 +4828,9 @@ package body Make is
if Main_Project /= No_Project if Main_Project /= No_Project
and then MLib.Tgt.Support_For_Libraries /= Prj.None and then MLib.Tgt.Support_For_Libraries /= Prj.None
and then (Do_Bind_Step and then (Do_Bind_Step
or Unique_Compile_All_Projects or Unique_Compile_All_Projects
or not Compile_Only) or not Compile_Only)
and then (Do_Link_Step or else Is_Last_Main) and then (Do_Link_Step or Is_Last_Main)
then then
Library_Phase Library_Phase
(Stand_Alone_Libraries => Stand_Alone_Libraries, (Stand_Alone_Libraries => Stand_Alone_Libraries,
...@@ -4864,9 +4854,7 @@ package body Make is ...@@ -4864,9 +4854,7 @@ package body Make is
then then
Inform (Msg => "objects up to date."); Inform (Msg => "objects up to date.");
elsif Do_Not_Execute elsif Do_Not_Execute and then First_Compiled_File /= No_File then
and then First_Compiled_File /= No_File
then
Write_Name (First_Compiled_File); Write_Name (First_Compiled_File);
Write_Eol; Write_Eol;
end if; end if;
...@@ -4883,12 +4871,12 @@ package body Make is ...@@ -4883,12 +4871,12 @@ package body Make is
-- 4) Made unit cannot be a main unit -- 4) Made unit cannot be a main unit
if ((Do_Not_Execute if ((Do_Not_Execute
or List_Dependencies or List_Dependencies
or not Do_Bind_Step or not Do_Bind_Step
or not Is_Main_Unit) or not Is_Main_Unit)
and then not No_Main_Subprogram and not No_Main_Subprogram
and then not Build_Bind_And_Link_Full_Project) and not Build_Bind_And_Link_Full_Project)
or else Unique_Compile or Unique_Compile
then then
Stop_Compile := True; Stop_Compile := True;
return; return;
...@@ -4905,17 +4893,13 @@ package body Make is ...@@ -4905,17 +4893,13 @@ package body Make is
Executable_Stamp := File_Stamp (Executable); Executable_Stamp := File_Stamp (Executable);
if not Executable_Obsolete then if not Executable_Obsolete then
Executable_Obsolete := Executable_Obsolete := Youngest_Obj_Stamp > Executable_Stamp;
Youngest_Obj_Stamp > Executable_Stamp;
end if; end if;
if not Executable_Obsolete then if not Executable_Obsolete then
for Index in reverse 1 .. Dependencies.Last loop for Index in reverse 1 .. Dependencies.Last loop
if Is_In_Obsoleted if Is_In_Obsoleted (Dependencies.Table (Index).Depends_On) then
(Dependencies.Table (Index).Depends_On) Enter_Into_Obsoleted (Dependencies.Table (Index).This);
then
Enter_Into_Obsoleted
(Dependencies.Table (Index).This);
end if; end if;
end loop; end loop;
...@@ -4940,9 +4924,7 @@ package body Make is ...@@ -4940,9 +4924,7 @@ package body Make is
-- executable: there may be an externally built library -- executable: there may be an externally built library
-- file that has been modified. -- file that has been modified.
if not Executable_Obsolete if not Executable_Obsolete and then Main_Project /= No_Project then
and then Main_Project /= No_Project
then
declare declare
Proj1 : Project_List; Proj1 : Project_List;
...@@ -4950,8 +4932,7 @@ package body Make is ...@@ -4950,8 +4932,7 @@ package body Make is
Proj1 := Project_Tree.Projects; Proj1 := Project_Tree.Projects;
while Proj1 /= null loop while Proj1 /= null loop
if Proj1.Project.Library if Proj1.Project.Library
and then and then Proj1.Project.Library_TS > Executable_Stamp
Proj1.Project.Library_TS > Executable_Stamp
then then
Executable_Obsolete := True; Executable_Obsolete := True;
Youngest_Obj_Stamp := Proj1.Project.Library_TS; Youngest_Obj_Stamp := Proj1.Project.Library_TS;
...@@ -5027,7 +5008,6 @@ package body Make is ...@@ -5027,7 +5008,6 @@ package body Make is
Default_Switches_Array : Array_Id; Default_Switches_Array : Array_Id;
begin begin
-- If there is a package Builder in the main project file, add -- If there is a package Builder in the main project file, add
-- the switches from it. -- the switches from it.
...@@ -5035,18 +5015,19 @@ package body Make is ...@@ -5035,18 +5015,19 @@ package body Make is
Global_Compilation_Array := Prj.Util.Value_Of Global_Compilation_Array := Prj.Util.Value_Of
(Name => Name_Global_Compilation_Switches, (Name => Name_Global_Compilation_Switches,
In_Arrays => Project_Tree.Shared.Packages.Table In_Arrays => Project_Tree.Shared.Packages.Table
(Builder_Package).Decl.Arrays, (Builder_Package).Decl.Arrays,
Shared => Project_Tree.Shared); Shared => Project_Tree.Shared);
Default_Switches_Array := Default_Switches_Array :=
Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays; Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays;
while Default_Switches_Array /= No_Array and then while Default_Switches_Array /= No_Array
Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Name and then
/= Name_Default_Switches Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Name /=
Name_Default_Switches
loop loop
Default_Switches_Array := Project_Tree.Shared.Arrays.Table Default_Switches_Array :=
(Default_Switches_Array).Next; Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Next;
end loop; end loop;
if Global_Compilation_Array /= No_Array_Element and then if Global_Compilation_Array /= No_Array_Element and then
...@@ -5060,10 +5041,9 @@ package body Make is ...@@ -5060,10 +5041,9 @@ package body Make is
Make_Failed ("*** illegal combination of Builder attributes"); Make_Failed ("*** illegal combination of Builder attributes");
end if; end if;
-- If there is only one main, we attempt to get the gnatmake -- If there is only one main, we attempt to get the gnatmake switches
-- switches for this main (if any). If there are no specific -- for this main (if any). If there are no specific switch for this
-- switch for this particular main, get the general gnatmake -- particular main, get the general gnatmake switches (if any).
-- switches (if any).
if Osint.Number_Of_Files = 1 then if Osint.Number_Of_Files = 1 then
if Verbose_Mode then if Verbose_Mode then
...@@ -5083,46 +5063,42 @@ package body Make is ...@@ -5083,46 +5063,42 @@ package body Make is
Global_Compilation_Array = No_Array_Element); Global_Compilation_Array = No_Array_Element);
else else
-- If there are several mains, we always get the general -- If there are several mains, we always get the general gnatmake
-- gnatmake switches (if any). -- switches (if any).
-- Warn the user, if necessary, so that he is not surprised -- Warn the user, if necessary, so that he is not surprised that
-- that specific switches are not taken into account. -- specific switches are not taken into account.
declare declare
Defaults : constant Variable_Value := Defaults : constant Variable_Value :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Ada, (Name => Name_Ada,
Index => 0, Index => 0,
Attribute_Or_Array_Name => Attribute_Or_Array_Name => Name_Default_Switches,
Name_Default_Switches, In_Package => Builder_Package,
In_Package => Shared => Project_Tree.Shared);
Builder_Package,
Shared => Project_Tree.Shared);
Switches : constant Array_Element_Id := Switches : constant Array_Element_Id :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Switches, (Name => Name_Switches,
In_Arrays => In_Arrays => Project_Tree.Shared.Packages.Table
Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays,
(Builder_Package).Decl.Arrays,
Shared => Project_Tree.Shared); Shared => Project_Tree.Shared);
Other_Switches : constant Variable_Value := Other_Switches : constant Variable_Value :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => All_Other_Names, (Name => All_Other_Names,
Index => 0, Index => 0,
Attribute_Or_Array_Name Attribute_Or_Array_Name => Name_Switches,
=> Name_Switches, In_Package => Builder_Package,
In_Package => Builder_Package, Shared => Project_Tree.Shared);
Shared => Project_Tree.Shared);
begin begin
if Other_Switches /= Nil_Variable_Value then if Other_Switches /= Nil_Variable_Value then
if not Quiet_Output if not Quiet_Output
and then Switches /= No_Array_Element and then Switches /= No_Array_Element
and then Project_Tree.Shared.Array_Elements.Table and then Project_Tree.Shared.Array_Elements.Table
(Switches).Next /= No_Array_Element (Switches).Next /= No_Array_Element
then then
Write_Line Write_Line
("Warning: using Builder'Switches(others), " ("Warning: using Builder'Switches(others), "
...@@ -5130,8 +5106,8 @@ package body Make is ...@@ -5130,8 +5106,8 @@ package body Make is
end if; end if;
Add_Switches Add_Switches
(Project_Node_Tree => Project_Node_Tree, (Project_Node_Tree => Project_Node_Tree,
Env => Root_Environment, Env => Root_Environment,
File_Name => " ", File_Name => " ",
Index => 0, Index => 0,
The_Package => Builder_Package, The_Package => Builder_Package,
...@@ -5150,10 +5126,10 @@ package body Make is ...@@ -5150,10 +5126,10 @@ package body Make is
Add_Switches Add_Switches
(Project_Node_Tree => Project_Node_Tree, (Project_Node_Tree => Project_Node_Tree,
Env => Root_Environment, Env => Root_Environment,
File_Name => " ", File_Name => " ",
Index => 0, Index => 0,
The_Package => Builder_Package, The_Package => Builder_Package,
Program => None); Program => None);
elsif not Quiet_Output elsif not Quiet_Output
and then Switches /= No_Array_Element and then Switches /= No_Array_Element
...@@ -5189,16 +5165,13 @@ package body Make is ...@@ -5189,16 +5165,13 @@ package body Make is
if Global_Compilation_Switches /= Nil_Variable_Value if Global_Compilation_Switches /= Nil_Variable_Value
and then not Global_Compilation_Switches.Default and then not Global_Compilation_Switches.Default
then then
-- We have found attribute -- We have found attribute Global_Compilation_Switches
-- Global_Compilation_Switches ("Ada"): put the -- ("Ada"): put the switches in the appropriate table.
-- switches in the appropriate table.
List := Global_Compilation_Switches.Values; List := Global_Compilation_Switches.Values;
while List /= Nil_String loop while List /= Nil_String loop
Elem := Elem :=
Project_Tree.Shared.String_Elements.Table Project_Tree.Shared.String_Elements.Table (List);
(List);
if Elem.Value /= No_Name then if Elem.Value /= No_Name then
Add_Switch Add_Switch
...@@ -5233,12 +5206,11 @@ package body Make is ...@@ -5233,12 +5206,11 @@ package body Make is
if Saved_Linker_Switches.Table (J).all = Output_Flag.all then if Saved_Linker_Switches.Table (J).all = Output_Flag.all then
declare declare
Exec_File_Name : constant String := Exec_File_Name : constant String :=
Saved_Linker_Switches.Table (J + 1).all; Saved_Linker_Switches.Table (J + 1).all;
begin begin
if not Is_Absolute_Path (Exec_File_Name) then if not Is_Absolute_Path (Exec_File_Name) then
Get_Name_String Get_Name_String (Main_Project.Exec_Directory.Display_Name);
(Main_Project.Exec_Directory.Display_Name);
Add_Str_To_Name_Buffer (Exec_File_Name); Add_Str_To_Name_Buffer (Exec_File_Name);
Saved_Linker_Switches.Table (J + 1) := Saved_Linker_Switches.Table (J + 1) :=
new String'(Name_Buffer (1 .. Name_Len)); new String'(Name_Buffer (1 .. Name_Len));
...@@ -5256,7 +5228,7 @@ package body Make is ...@@ -5256,7 +5228,7 @@ package body Make is
declare declare
Dir_Path : constant String := Dir_Path : constant String :=
Get_Name_String (Main_Project.Directory.Display_Name); Get_Name_String (Main_Project.Directory.Display_Name);
begin begin
for J in 1 .. Binder_Switches.Last loop for J in 1 .. Binder_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
...@@ -5268,14 +5240,15 @@ package body Make is ...@@ -5268,14 +5240,15 @@ package body Make is
for J in 1 .. Saved_Binder_Switches.Last loop for J in 1 .. Saved_Binder_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
(Saved_Binder_Switches.Table (J), (Saved_Binder_Switches.Table (J),
Do_Fail => Make_Failed'Access, Do_Fail => Make_Failed'Access,
Parent => Current_Work_Dir, Parent => Current_Work_Dir,
Including_L_Switch => False); Including_L_Switch => False);
end loop; end loop;
for J in 1 .. Linker_Switches.Last loop for J in 1 .. Linker_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
(Linker_Switches.Table (J), Parent => Dir_Path, (Linker_Switches.Table (J),
Parent => Dir_Path,
Do_Fail => Make_Failed'Access); Do_Fail => Make_Failed'Access);
end loop; end loop;
...@@ -5283,13 +5256,13 @@ package body Make is ...@@ -5283,13 +5256,13 @@ package body Make is
Test_If_Relative_Path Test_If_Relative_Path
(Saved_Linker_Switches.Table (J), (Saved_Linker_Switches.Table (J),
Do_Fail => Make_Failed'Access, Do_Fail => Make_Failed'Access,
Parent => Current_Work_Dir); Parent => Current_Work_Dir);
end loop; end loop;
for J in 1 .. Gcc_Switches.Last loop for J in 1 .. Gcc_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
(Gcc_Switches.Table (J), (Gcc_Switches.Table (J),
Do_Fail => Make_Failed'Access, Do_Fail => Make_Failed'Access,
Parent => Dir_Path, Parent => Dir_Path,
Including_Non_Switch => False); Including_Non_Switch => False);
end loop; end loop;
...@@ -5298,7 +5271,7 @@ package body Make is ...@@ -5298,7 +5271,7 @@ package body Make is
Test_If_Relative_Path Test_If_Relative_Path
(Saved_Gcc_Switches.Table (J), (Saved_Gcc_Switches.Table (J),
Parent => Current_Work_Dir, Parent => Current_Work_Dir,
Do_Fail => Make_Failed'Access, Do_Fail => Make_Failed'Access,
Including_Non_Switch => False); Including_Non_Switch => False);
end loop; end loop;
end; end;
...@@ -5322,14 +5295,13 @@ package body Make is ...@@ -5322,14 +5295,13 @@ package body Make is
if Proj.Project.Library then if Proj.Project.Library then
Proj.Project.Need_To_Build_Lib := Proj.Project.Need_To_Build_Lib :=
not MLib.Tgt.Library_Exists_For not MLib.Tgt.Library_Exists_For
(Proj.Project, Project_Tree) (Proj.Project, Project_Tree)
and then not Proj.Project.Externally_Built; and then not Proj.Project.Externally_Built;
if Proj.Project.Need_To_Build_Lib then if Proj.Project.Need_To_Build_Lib then
-- If there is no object directory, then it will be -- If there is no object directory, then it will be
-- impossible to build the library. So fail -- impossible to build the library, so fail immediately.
-- immediately.
if Proj.Project.Object_Directory = if Proj.Project.Object_Directory =
No_Path_Information No_Path_Information
...@@ -5409,11 +5381,11 @@ package body Make is ...@@ -5409,11 +5381,11 @@ package body Make is
Executable := Executable_Name (Strip_Suffix (Main_Source_File)); Executable := Executable_Name (Strip_Suffix (Main_Source_File));
else else
-- If we are using a project file, we attempt to remove the -- If we are using a project file, we attempt to remove the body
-- body (or spec) termination of the main subprogram. We find -- (or spec) termination of the main subprogram. We find it the
-- it the naming scheme of the project file. This avoids -- naming scheme of the project file. This avoids generating an
-- generating an executable "main.2" for a main subprogram -- executable "main.2" for a main subprogram "main.2.ada", when
-- "main.2.ada", when the body termination is ".2.ada". -- the body termination is ".2.ada".
Executable := Executable :=
Prj.Util.Executable_Of Prj.Util.Executable_Of
...@@ -5459,25 +5431,24 @@ package body Make is ...@@ -5459,25 +5431,24 @@ package body Make is
Main_Unit_File_Name : constant String := Main_Unit_File_Name : constant String :=
Prj.Env.File_Name_Of_Library_Unit_Body Prj.Env.File_Name_Of_Library_Unit_Body
(Name => Main_Source_File_Name, (Name => Main_Source_File_Name,
Project => Main_Project, Project => Main_Project,
In_Tree => Project_Tree, In_Tree => Project_Tree,
Main_Project_Only => Main_Project_Only => not Unique_Compile);
not Unique_Compile);
The_Packages : constant Package_Id := Main_Project.Decl.Packages; The_Packages : constant Package_Id := Main_Project.Decl.Packages;
Binder_Package : constant Prj.Package_Id := Binder_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Binder, (Name => Name_Binder,
In_Packages => The_Packages, In_Packages => The_Packages,
Shared => Project_Tree.Shared); Shared => Project_Tree.Shared);
Linker_Package : constant Prj.Package_Id := Linker_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of Prj.Util.Value_Of
(Name => Name_Linker, (Name => Name_Linker,
In_Packages => The_Packages, In_Packages => The_Packages,
Shared => Project_Tree.Shared); Shared => Project_Tree.Shared);
begin begin
-- We fail if we cannot find the main source file -- We fail if we cannot find the main source file
...@@ -5528,24 +5499,24 @@ package body Make is ...@@ -5528,24 +5499,24 @@ package body Make is
Resolve_Relative_Names_In_Switches Resolve_Relative_Names_In_Switches
(Current_Work_Dir => Current_Work_Dir); (Current_Work_Dir => Current_Work_Dir);
-- Record the current last switch index for table -- Record current last switch index for tables Binder_Switches
-- Binder_Switches and Linker_Switches, so that these tables -- and Linker_Switches, so that these tables may be reset
-- may be reset before each main, before adding switches from -- before each main, before adding switches from the project
-- the project file and from the command line. -- file and from the command line.
Last_Binder_Switch := Binder_Switches.Last; Last_Binder_Switch := Binder_Switches.Last;
Last_Linker_Switch := Linker_Switches.Last; Last_Linker_Switch := Linker_Switches.Last;
else else
-- Reset the tables Binder_Switches and Linker_Switches -- Reset the tables Binder_Switches and Linker_Switches
Binder_Switches.Set_Last (Last_Binder_Switch); Binder_Switches.Set_Last (Last_Binder_Switch);
Linker_Switches.Set_Last (Last_Linker_Switch); Linker_Switches.Set_Last (Last_Linker_Switch);
end if; end if;
-- We now deal with the binder and linker switches. -- We now deal with the binder and linker switches. If no project
-- If no project file is used, there is nothing to do -- file is used, there is nothing to do because the binder and
-- because the binder and linker switches are the same -- linker switches are the same for all mains.
-- for all mains.
-- Add binder switches from the project file for the first main -- Add binder switches from the project file for the first main
...@@ -5583,10 +5554,10 @@ package body Make is ...@@ -5583,10 +5554,10 @@ package body Make is
Program => Linker); Program => Linker);
end if; end if;
-- As we are using a project file, for relative paths we add -- As we are using a project file, for relative paths we add the
-- the current working directory for any relative path on -- current working directory for any relative path on the command
-- the command line and the project directory, for any -- line and the project directory, for any relative path in the
-- relative path in the project file. -- project file.
declare declare
Dir_Path : constant String := Dir_Path : constant String :=
...@@ -5610,7 +5581,9 @@ package body Make is ...@@ -5610,7 +5581,9 @@ package body Make is
else else
if not Compute_Builder then if not Compute_Builder then
-- Reset the tables Binder_Switches and Linker_Switches -- Reset the tables Binder_Switches and Linker_Switches
Binder_Switches.Set_Last (Last_Binder_Switch); Binder_Switches.Set_Last (Last_Binder_Switch);
Linker_Switches.Set_Last (Last_Linker_Switch); Linker_Switches.Set_Last (Last_Linker_Switch);
end if; end if;
...@@ -5622,11 +5595,10 @@ package body Make is ...@@ -5622,11 +5595,10 @@ package body Make is
Display_Commands (not Quiet_Output); Display_Commands (not Quiet_Output);
end if; end if;
-- We now put in the Binder_Switches and Linker_Switches tables, -- We now put in the Binder_Switches and Linker_Switches tables, the
-- the binder and linker switches of the command line that have -- binder and linker switches of the command line that have been put in
-- been put in the Saved_ tables. If a project file was used, then -- the Saved_ tables. If a project file was used, then the command line
-- the command line switches will follow the project file -- switches will follow the project file switches.
-- switches.
for J in 1 .. Saved_Binder_Switches.Last loop for J in 1 .. Saved_Binder_Switches.Last loop
Add_Switch Add_Switch
...@@ -5727,6 +5699,7 @@ package body Make is ...@@ -5727,6 +5699,7 @@ package body Make is
-- Special case when switch -B was specified -- Special case when switch -B was specified
if Build_Bind_And_Link_Full_Project then if Build_Bind_And_Link_Full_Project then
-- When switch -B is specified, there must be a project file -- When switch -B is specified, there must be a project file
if Main_Project = No_Project then if Main_Project = No_Project then
...@@ -5775,6 +5748,7 @@ package body Make is ...@@ -5775,6 +5748,7 @@ package body Make is
Make_Failed ("cannot specify several mains with a multi-unit index"); Make_Failed ("cannot specify several mains with a multi-unit index");
elsif Main_Project /= No_Project then elsif Main_Project /= No_Project then
-- If the main project file is a library project file, main(s) cannot -- If the main project file is a library project file, main(s) cannot
-- be specified on the command line. -- be specified on the command line.
...@@ -5807,8 +5781,9 @@ package body Make is ...@@ -5807,8 +5781,9 @@ package body Make is
if Value = Prj.Nil_String or else Unique_Compile then if Value = Prj.Nil_String or else Unique_Compile then
if (not Make_Steps) or else Compile_Only if not Make_Steps
or else not Main_Project.Library or Compile_Only
or not Main_Project.Library
then then
-- First make sure that the binder and the linker will -- First make sure that the binder and the linker will
-- not be invoked. -- not be invoked.
...@@ -5892,16 +5867,17 @@ package body Make is ...@@ -5892,16 +5867,17 @@ package body Make is
declare declare
Main_Name : constant String := Main_Name : constant String :=
Get_Name_String Get_Name_String
(Project_Tree.Shared.String_Elements.Table (Project_Tree.Shared.
(Value).Value); String_Elements.
Table (Value).Value);
Proj : constant Project_Id := Proj : constant Project_Id :=
Prj.Env.Project_Of Prj.Env.Project_Of
(Main_Name, Main_Project, Project_Tree); (Main_Name, Main_Project, Project_Tree);
begin
begin
if Proj = Main_Project then if Proj = Main_Project then
At_Least_One_Main := True; At_Least_One_Main := True;
Osint.Add_File Osint.Add_File
(Get_Name_String (Get_Name_String
...@@ -5950,9 +5926,7 @@ package body Make is ...@@ -5950,9 +5926,7 @@ package body Make is
end if; end if;
if Osint.Number_Of_Files = 0 then if Osint.Number_Of_Files = 0 then
if Main_Project /= No_Project if Main_Project /= No_Project and then Main_Project.Library then
and then Main_Project.Library
then
if Do_Bind_Step if Do_Bind_Step
and then not Main_Project.Standalone_Library and then not Main_Project.Standalone_Library
then then
...@@ -6050,19 +6024,18 @@ package body Make is ...@@ -6050,19 +6024,18 @@ package body Make is
if Main_Project /= No_Project then if Main_Project /= No_Project then
if Main_Project.Object_Directory /= No_Path_Information then if Main_Project.Object_Directory /= No_Path_Information then
-- Change current directory to object directory of main project -- Change current directory to object directory of main project
Project_Of_Current_Object_Directory := No_Project; Project_Of_Current_Object_Directory := No_Project;
Change_To_Object_Directory (Main_Project); Change_To_Object_Directory (Main_Project);
end if; end if;
-- Source file lookups should be cached for efficiency. -- Source file lookups should be cached for efficiency. Source files
-- Source files are not supposed to change. -- are not supposed to change.
Osint.Source_File_Data (Cache => True); Osint.Source_File_Data (Cache => True);
Osint.Add_Default_Search_Dirs; Osint.Add_Default_Search_Dirs;
Queue_Library_Project_Sources; Queue_Library_Project_Sources;
end if; end if;
...@@ -6183,8 +6156,10 @@ package body Make is ...@@ -6183,8 +6156,10 @@ package body Make is
declare declare
Data : Project_Compilation_Access; Data : Project_Compilation_Access;
Proj : Project_List := Project_Tree.Projects; Proj : Project_List;
begin begin
Proj := Project_Tree.Projects;
while Proj /= null loop while Proj /= null loop
Data := new Project_Compilation_Data' Data := new Project_Compilation_Data'
(Mapping_File_Names => new Temp_Path_Names (Mapping_File_Names => new Temp_Path_Names
...@@ -6480,7 +6455,7 @@ package body Make is ...@@ -6480,7 +6455,7 @@ package body Make is
Env : out Prj.Tree.Environment) Env : out Prj.Tree.Environment)
is is
procedure Check_Version_And_Help is procedure Check_Version_And_Help is
new Check_Version_And_Help_G (Makeusg); new Check_Version_And_Help_G (Makeusg);
-- Start of processing for Initialize -- Start of processing for Initialize
...@@ -6726,6 +6701,7 @@ package body Make is ...@@ -6726,6 +6701,7 @@ package body Make is
-- We add the source directories and the object directories to the -- We add the source directories and the object directories to the
-- search paths. -- search paths.
-- ??? Why do we need these search directories, we already know the -- ??? Why do we need these search directories, we already know the
-- locations from parsing the project, except for the runtime which -- locations from parsing the project, except for the runtime which
-- has its own directories anyway -- has its own directories anyway
...@@ -6817,7 +6793,7 @@ package body Make is ...@@ -6817,7 +6793,7 @@ package body Make is
-- Start of processing for Insert_Project_Sources -- Start of processing for Insert_Project_Sources
begin begin
-- For all the sources in the project files, -- Loop through all the sources in the project files
Unit := Units_Htable.Get_First (Project_Tree.Units_HT); Unit := Units_Htable.Get_First (Project_Tree.Units_HT);
while Unit /= null loop while Unit /= null loop
......
...@@ -1350,11 +1350,14 @@ package body Makeutl is ...@@ -1350,11 +1350,14 @@ package body Makeutl is
Base_Main : String) return Prj.Source_Id Base_Main : String) return Prj.Source_Id
is is
Spec_Source : Prj.Source_Id := No_Source; Spec_Source : Prj.Source_Id := No_Source;
Source : Prj.Source_Id := No_Source; Source : Prj.Source_Id;
Project : Project_Id := Root_Project; Project : Project_Id;
Iter : Source_Iterator; Iter : Source_Iterator;
Suffix : File_Name_Type; Suffix : File_Name_Type;
begin begin
Source := No_Source;
Project := Root_Project;
while Source = No_Source while Source = No_Source
and then Project /= No_Project and then Project /= No_Project
loop loop
...@@ -1429,12 +1432,13 @@ package body Makeutl is ...@@ -1429,12 +1432,13 @@ package body Makeutl is
for J in reverse Names.First .. Names.Last loop for J in reverse Names.First .. Names.Last loop
declare declare
File : Main_Info := Names.Table (J); File : Main_Info := Names.Table (J);
Main_Id : File_Name_Type := File.File; Main_Id : File_Name_Type := File.File;
Main : constant String := Get_Name_String (Main_Id); Main : constant String :=
Base : constant String := Base_Name (Main); Get_Name_String (Main_Id);
Source : Prj.Source_Id := No_Source; Base : constant String := Base_Name (Main);
Is_Absolute : Boolean := False; Source : Prj.Source_Id := No_Source;
Is_Absolute : Boolean := False;
begin begin
if Base /= Main then if Base /= Main then
...@@ -1444,10 +1448,10 @@ package body Makeutl is ...@@ -1444,10 +1448,10 @@ package body Makeutl is
else else
declare declare
Absolute : constant String := Absolute : constant String :=
Normalize_Pathname Normalize_Pathname
(Name => Main, (Name => Main,
Directory => "", Directory => "",
Resolve_Links => False); Resolve_Links => False);
begin begin
File.File := Create_Name (Absolute); File.File := Create_Name (Absolute);
Main_Id := Create_Name (Base); Main_Id := Create_Name (Base);
...@@ -1504,15 +1508,19 @@ package body Makeutl is ...@@ -1504,15 +1508,19 @@ package body Makeutl is
end if; end if;
if Source = No_Source then if Source = No_Source then
-- Still not found ? Maybe we have a unit name
-- Still not found? Maybe we have a unit name
declare declare
Unit : constant Unit_Index := Unit : constant Unit_Index :=
Units_Htable.Get Units_Htable.Get
(File.Tree.Units_HT, Name_Id (Main_Id)); (File.Tree.Units_HT,
begin Name_Id (Main_Id));
begin
if Unit /= No_Unit_Index then if Unit /= No_Unit_Index then
Source := Unit.File_Names (Impl); Source := Unit.File_Names (Impl);
if Source = No_Source then if Source = No_Source then
Source := Unit.File_Names (Spec); Source := Unit.File_Names (Spec);
end if; end if;
...@@ -1527,9 +1535,7 @@ package body Makeutl is ...@@ -1527,9 +1535,7 @@ package body Makeutl is
-- to compile all the units from the same source -- to compile all the units from the same source
-- file. -- file.
if Source.Index /= 0 if Source.Index /= 0 and then File.Index = 0 then
and then File.Index = 0
then
Add_Multi_Unit_Sources (File.Tree, Source); Add_Multi_Unit_Sources (File.Tree, Source);
end if; end if;
...@@ -1564,8 +1570,7 @@ package body Makeutl is ...@@ -1564,8 +1570,7 @@ package body Makeutl is
Error_Msg_File_1 := Main_Id; Error_Msg_File_1 := Main_Id;
Error_Msg_Name_1 := Root_Project.Name; Error_Msg_Name_1 := Root_Project.Name;
Prj.Err.Error_Msg Prj.Err.Error_Msg
(Flags, (Flags, "{ is not a source of project %%",
"{ is not a source of project %%",
File.Location, Project); File.Location, Project);
end if; end if;
end if; end if;
...@@ -1832,8 +1837,10 @@ package body Makeutl is ...@@ -1832,8 +1837,10 @@ package body Makeutl is
elsif Sw'Length >= 4 elsif Sw'Length >= 4
and then (Sw (2 .. 3) = "aL" and then (Sw (2 .. 3) = "aL"
or else Sw (2 .. 3) = "aO" or else
or else Sw (2 .. 3) = "aI") Sw (2 .. 3) = "aO"
or else
Sw (2 .. 3) = "aI")
then then
Start := 4; Start := 4;
...@@ -1923,7 +1930,6 @@ package body Makeutl is ...@@ -1923,7 +1930,6 @@ package body Makeutl is
Start := Finish; Start := Finish;
Finish := Finish - 1; Finish := Finish - 1;
while Start >= 1 and then Name_Buffer (Start - 1) in '0' .. '9' loop while Start >= 1 and then Name_Buffer (Start - 1) in '0' .. '9' loop
Start := Start - 1; Start := Start - 1;
end loop; end loop;
...@@ -2644,6 +2650,7 @@ package body Makeutl is ...@@ -2644,6 +2650,7 @@ package body Makeutl is
Iter : Source_Iterator; Iter : Source_Iterator;
Source : Prj.Source_Id; Source : Prj.Source_Id;
begin begin
-- Nothing to do when "-u" was specified and some files were -- Nothing to do when "-u" was specified and some files were
-- specified on the command line -- specified on the command line
...@@ -2662,23 +2669,23 @@ package body Makeutl is ...@@ -2662,23 +2669,23 @@ package body Makeutl is
if Is_Compilable (Source) if Is_Compilable (Source)
and then and then
(All_Projects (All_Projects
or else Is_Extending (Project, Source.Project)) or else Is_Extending (Project, Source.Project))
and then not Source.Locally_Removed and then not Source.Locally_Removed
and then Source.Replaced_By = No_Source and then Source.Replaced_By = No_Source
and then and then
(not Source.Project.Externally_Built (not Source.Project.Externally_Built
or else or else
(Is_Extending (Project, Source.Project) (Is_Extending (Project, Source.Project)
and then not Project.Externally_Built)) and then not Project.Externally_Built))
and then Source.Kind /= Sep and then Source.Kind /= Sep
and then Source.Path /= No_Path_Information and then Source.Path /= No_Path_Information
then then
if Source.Kind = Impl if Source.Kind = Impl
or else (Source.Unit /= No_Unit_Index or else (Source.Unit /= No_Unit_Index
and then Source.Kind = Spec and then Source.Kind = Spec
and then (Other_Part (Source) = No_Source and then (Other_Part (Source) = No_Source
or else or else
Other_Part (Source).Locally_Removed)) Other_Part (Source).Locally_Removed))
then then
if (Unit_Based if (Unit_Based
or else Source.Unit = No_Unit_Index or else Source.Unit = No_Unit_Index
...@@ -2712,9 +2719,9 @@ package body Makeutl is ...@@ -2712,9 +2719,9 @@ package body Makeutl is
Project_Tree : Project_Tree_Ref; Project_Tree : Project_Tree_Ref;
Excluding_Shared_SALs : Boolean := False) Excluding_Shared_SALs : Boolean := False)
is is
Sfile : File_Name_Type; Sfile : File_Name_Type;
Afile : File_Name_Type; Afile : File_Name_Type;
Src_Id : Prj.Source_Id; Src_Id : Prj.Source_Id;
begin begin
-- Insert in the queue the unmarked source files (i.e. those which -- Insert in the queue the unmarked source files (i.e. those which
...@@ -2745,7 +2752,7 @@ package body Makeutl is ...@@ -2745,7 +2752,7 @@ package body Makeutl is
when Spec => when Spec =>
declare declare
Bdy : constant Prj.Source_Id := Bdy : constant Prj.Source_Id :=
Other_Part (Src_Id); Other_Part (Src_Id);
begin begin
if Bdy /= No_Source if Bdy /= No_Source
and then not Bdy.Locally_Removed and then not Bdy.Locally_Removed
...@@ -2838,9 +2845,9 @@ package body Makeutl is ...@@ -2838,9 +2845,9 @@ package body Makeutl is
procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref) is procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref) is
Data : constant Builder_Data_Access := Builder_Data (Tree); Data : constant Builder_Data_Access := Builder_Data (Tree);
All_Phases : constant Boolean := All_Phases : constant Boolean :=
not Option_Compile_Only not Option_Compile_Only
and then not Option_Bind_Only and then not Option_Bind_Only
and then not Option_Link_Only; and then not Option_Link_Only;
-- Whether the command line asked for all three phases. Depending on -- Whether the command line asked for all three phases. Depending on
-- the project settings, we might still disable some of the phases. -- the project settings, we might still disable some of the phases.
......
...@@ -2602,7 +2602,7 @@ package body Sem_Ch10 is ...@@ -2602,7 +2602,7 @@ package body Sem_Ch10 is
Par_Name := Entity (Pref); Par_Name := Entity (Pref);
end if; end if;
-- Guard against missing or misspelled child units. -- Guard against missing or misspelled child units
if Present (Par_Name) then if Present (Par_Name) then
Set_Entity_With_Style_Check (Pref, Par_Name); Set_Entity_With_Style_Check (Pref, Par_Name);
......
...@@ -4355,7 +4355,7 @@ package body Sem_Res is ...@@ -4355,7 +4355,7 @@ package body Sem_Res is
then then
Error_Msg_N Error_Msg_N
("cannot activate task before body seen?", N); ("cannot activate task before body seen?", N);
Error_Msg_N ("\Program_Error will be raised at run time", N); Error_Msg_N ("\Program_Error will be raised at run time?", N);
end if; end if;
end Resolve_Allocator; end Resolve_Allocator;
......
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