diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 268cd62ac70..30b7b301e89 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2009-04-29 Robert Dewar + + * rtsfind.adb, prj-env.adb: Minor reformatting + Minor code reorganization + +2009-04-29 Emmanuel Briot + + * make.adb: Fix comment + + * prj.adb (Ultimate_Extending_Project_Of): Fix handling when no project + is given as argument, as might happen in gnatmake. + 2009-04-29 Ed Schonberg * sem_ch3.adb (Check_Abstract_Overriding): Improve error message when diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 0e274e81a07..f7d7b37a15a 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -7469,7 +7469,7 @@ package body Make is begin if Prj.Depth >= Depth - or Get (Seen, Prj) -- or needed instead of or else ??? + or else Get (Seen, Prj) then return; end if; diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 25a23291b3b..0a06975ced8 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -954,11 +954,13 @@ package body Prj.Env is end if; -- If language is defined + else -- For all source of the Language of all projects in the closure declare P : Project_List; + begin P := In_Tree.Projects; while P /= null loop @@ -1054,7 +1056,7 @@ package body Prj.Env is procedure Delete_All_Path_Files (In_Tree : Project_Tree_Ref) is Disregard : Boolean := True; - pragma Warnings (Off, Disregard); + pragma Unreferenced (Disregard); begin for Index in Path_File_Table.First .. @@ -1846,9 +1848,10 @@ package body Prj.Env is function Ultimate_Extension_Of (Project : Project_Id) return Project_Id is - Result : Project_Id := Project; + Result : Project_Id; begin + Result := Project; while Result.Extended_By /= No_Project loop Result := Result.Extended_By; end loop; diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index f79716944f5..49d9c5711a0 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -828,6 +828,7 @@ package body Prj is procedure Free (Project : in out Project_Id; Reset_Only : Boolean) is procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Project_Data, Project_Id); + begin if Project /= null then Free (Project.Include_Path); @@ -891,9 +892,11 @@ package body Prj is procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Project_List_Element, Project_List); Tmp : Project_List; + begin while List /= null loop Tmp := List.Next; + if Free_Project then Free (List.Project, Reset_Only => Reset_Only); end if; @@ -950,6 +953,8 @@ package body Prj is Source_Path_Table.Free (Tree.Private_Part.Source_Paths); Object_Path_Table.Free (Tree.Private_Part.Object_Paths); + Free (Tree.Private_Part.Ada_Path_Buffer); + -- Naming data (nothing to free ?) null; @@ -1385,7 +1390,7 @@ package body Prj is begin Prj := Proj; - while Prj.Extended_By /= No_Project loop + while Prj /= null and then Prj.Extended_By /= No_Project loop Prj := Prj.Extended_By; end loop; diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index 45c9370456a..76f14c17712 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -1459,8 +1459,10 @@ package body Rtsfind is if Chrs = Chars (Cunit_Entity (Current_Sem_Unit)) then declare - Parent_Name : constant Unit_Name_Type - := Get_Parent_Spec_Name (Unit_Name (Current_Sem_Unit)); + Parent_Name : constant Unit_Name_Type := + Get_Parent_Spec_Name + (Unit_Name (Current_Sem_Unit)); + begin if Parent_Name /= No_Unit_Name then Get_Name_String (Parent_Name); @@ -1468,9 +1470,9 @@ package body Rtsfind is declare P : String renames Name_Buffer (1 .. Name_Len); begin - if P = "ada.text_io%s" - or else P = "ada.wide_text_io%s" - or else P = "ada.wide_wide_text_io%s" + if P = "ada.text_io%s" or else + P = "ada.wide_text_io%s" or else + P = "ada.wide_wide_text_io%s" then goto Continue; end if;