From: Robert Dewar Date: Wed, 29 Apr 2009 09:28:07 +0000 (+0000) Subject: mlib-prj.adb, [...]: Minor reformatting Minor code reorganization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=132410cb49cc8dbb163e119e74fa54f389c6153d;p=gcc.git mlib-prj.adb, [...]: Minor reformatting Minor code reorganization 2009-04-29 Robert Dewar * mlib-prj.adb, mlib-tgt.adb, mlib-tgt.ads, prj-nmsc.adb, prj-proc.adb: Minor reformatting Minor code reorganization From-SVN: r146933 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 94f9eb7bd98..3a114f43baf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-04-29 Robert Dewar + + * mlib-prj.adb, mlib-tgt.adb, mlib-tgt.ads, prj-nmsc.adb, + prj-proc.adb: Minor reformatting + Minor code reorganization + 2009-04-29 Bob Duff * exp_ch7.adb (Build_Final_List): For an access type that designates a diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb index d08257e00d6..67d9330ae9e 100644 --- a/gcc/ada/mlib-prj.adb +++ b/gcc/ada/mlib-prj.adb @@ -480,8 +480,10 @@ package body MLib.Prj is elsif P /= No_Project then declare - Proj : Project_Id := For_Project; + Proj : Project_Id; + begin + Proj := For_Project; while Proj.Extends /= No_Project loop if P = Proj.Extends then return True; @@ -518,12 +520,12 @@ package body MLib.Prj is Lib_File := Name_Find; Text := Read_Library_Info (Lib_File, True); - Id := ALI.Scan_ALI - (F => Lib_File, - T => Text, - Ignore_ED => False, - Err => True, - Read_Lines => "D"); + Id := ALI.Scan_ALI + (F => Lib_File, + T => Text, + Ignore_ED => False, + Err => True, + Read_Lines => "D"); Free (Text); -- Look for s-osinte.ads in the dependencies @@ -2069,7 +2071,7 @@ package body MLib.Prj is if For_Project.Library then declare Lib_Name : constant File_Name_Type := - Library_File_Name_For (For_Project, In_Tree); + Library_File_Name_For (For_Project, In_Tree); begin Change_Dir (Get_Name_String (For_Project.Library_Dir.Name)); Lib_TS := File_Stamp (Lib_Name); diff --git a/gcc/ada/mlib-tgt.adb b/gcc/ada/mlib-tgt.adb index 164d4dc9167..b07bb74d687 100644 --- a/gcc/ada/mlib-tgt.adb +++ b/gcc/ada/mlib-tgt.adb @@ -317,7 +317,8 @@ package body MLib.Tgt is ------------------------ function Library_Exists_For - (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return Boolean is begin return Library_Exists_For_Ptr (Project, In_Tree); @@ -328,9 +329,11 @@ package body MLib.Tgt is -------------------------------- function Library_Exists_For_Default - (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return Boolean is pragma Unreferenced (In_Tree); + begin if not Project.Library then Prj.Com.Fail ("INTERNAL ERROR: Library_Exists_For called " & diff --git a/gcc/ada/mlib-tgt.ads b/gcc/ada/mlib-tgt.ads index b418745c8c3..cbb15d3ac1d 100644 --- a/gcc/ada/mlib-tgt.ads +++ b/gcc/ada/mlib-tgt.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2008, AdaCore -- +-- Copyright (C) 2001-2009, AdaCore -- -- -- -- 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- -- @@ -140,7 +140,8 @@ package MLib.Tgt is -- are ignored. function Library_Exists_For - (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean; + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return Boolean; -- Return True if the library file for a library project already exists. -- This function can only be called for library projects. @@ -166,6 +167,7 @@ private type Is_Ext_Function is access function (Ext : String) return Boolean; type String_List_Access_Function is access function return String_List_Access; + type Build_Dynamic_Library_Function is access procedure (Ofiles : Argument_List; Options : Argument_List; @@ -176,11 +178,15 @@ private Driver_Name : Name_Id := No_Name; Lib_Version : String := ""; Auto_Init : Boolean := False); + type Library_Exists_For_Function is access function - (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean; + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return Boolean; + type Library_File_Name_For_Function is access function (Project : Project_Id; In_Tree : Project_Tree_Ref) return File_Name_Type; + type Boolean_Function is access function return Boolean; type Library_Support_Function is access function return Library_Support; @@ -233,12 +239,14 @@ private Libgnat_Ptr : String_Function := Libgnat_Default'Access; function Library_Exists_For_Default - (Project : Project_Id; In_Tree : Project_Tree_Ref) return Boolean; + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return Boolean; Library_Exists_For_Ptr : Library_Exists_For_Function := Library_Exists_For_Default'Access; function Library_File_Name_For_Default - (Project : Project_Id; In_Tree : Project_Tree_Ref) return File_Name_Type; + (Project : Project_Id; + In_Tree : Project_Tree_Ref) return File_Name_Type; Library_File_Name_For_Ptr : Library_File_Name_For_Function := Library_File_Name_For_Default'Access; diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 1f347a95d24..372f950a9b6 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -3147,7 +3147,7 @@ package body Prj.Nmsc is -- Check Body_Suffix if Is_Illegal_Suffix - (Body_Suffix, Project.Naming.Dot_Replacement) + (Body_Suffix, Project.Naming.Dot_Replacement) then Err_Vars.Error_Msg_File_1 := Body_Suffix; Error_Msg @@ -3468,6 +3468,7 @@ package body Prj.Nmsc is -- Special case of extending project if Project.Extends /= No_Project then + -- If the project extended is a library project, we inherit the -- library name, if it is not redefined; we check that the library -- directory is specified. @@ -3686,7 +3687,7 @@ package body Prj.Nmsc is Project.Library := Project.Library_Dir /= No_Path_Information - and then Project.Library_Name /= No_Name; + and then Project.Library_Name /= No_Name; if Project.Extends = No_Project then case Project.Qualifier is @@ -3741,6 +3742,7 @@ package body Prj.Nmsc is if Current_Verbosity = High then Write_Line ("No library ALI directory specified"); end if; + Project.Library_ALI_Dir := Project.Library_Dir; else @@ -5763,11 +5765,11 @@ package body Prj.Nmsc is else -- Remove source dir, if present - List := Project.Source_Dirs; Prev := Nil_String; -- Look for source dir in current list + List := Project.Source_Dirs; while List /= Nil_String loop Element := In_Tree.String_Elements.Table (List); exit when Element.Value = Path_Id; @@ -5807,13 +5809,12 @@ package body Prj.Nmsc is if (((not Source_Files.Default) and then Source_Files.Values = Nil_String) or else - ((not Source_Dirs.Default) and then Source_Dirs.Values = Nil_String) - or else - ((not Languages.Default) and then Languages.Values = Nil_String)) + ((not Source_Dirs.Default) and then Source_Dirs.Values = Nil_String) + or else + ((not Languages.Default) and then Languages.Values = Nil_String)) and then Project.Extends = No_Project then Project.Object_Directory := No_Path_Information; - else Project.Object_Directory := Project.Directory; end if; @@ -8208,7 +8209,7 @@ package body Prj.Nmsc is and then UData.File_Names (Unit_Kind).Path.Name = Slash) or else UData.File_Names (Unit_Kind).Name = No_File or else Is_Extending - (Project.Extends, UData.File_Names (Unit_Kind).Project) + (Project.Extends, UData.File_Names (Unit_Kind).Project) then if UData.File_Names (Unit_Kind).Path.Name = Slash then Remove_Forbidden_File_Name diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 0ddc9ced559..4fbc0a783b4 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -1164,9 +1164,10 @@ package body Prj.Proc is -- if the project is not imported directly. declare - Proj : Project_Id := Result.Extends; + Proj : Project_Id; begin + Proj := Result.Extends; while Proj /= No_Project loop if Proj.Name = With_Name then Temp_Result := Result; @@ -1571,8 +1572,7 @@ package body Prj.Proc is end loop; Orig_Array := - In_Tree.Packages.Table - (Orig_Package).Decl.Arrays; + In_Tree.Packages.Table (Orig_Package).Decl.Arrays; end if; -- Now look for the array