mlib-prj.adb, [...]: Minor reformatting Minor code reorganization
authorRobert Dewar <dewar@adacore.com>
Wed, 29 Apr 2009 09:28:07 +0000 (09:28 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Apr 2009 09:28:07 +0000 (11:28 +0200)
2009-04-29  Robert Dewar  <dewar@adacore.com>

* mlib-prj.adb, mlib-tgt.adb, mlib-tgt.ads, prj-nmsc.adb,
prj-proc.adb: Minor reformatting
Minor code reorganization

From-SVN: r146933

gcc/ada/ChangeLog
gcc/ada/mlib-prj.adb
gcc/ada/mlib-tgt.adb
gcc/ada/mlib-tgt.ads
gcc/ada/prj-nmsc.adb
gcc/ada/prj-proc.adb

index 94f9eb7bd98dcc1f1bc6a0bd0bec659bfa4e841f..3a114f43baf945c0aaa384000e8ab1327e6ebb1c 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-29  Robert Dewar  <dewar@adacore.com>
+
+       * 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  <duff@adacore.com>
 
        * exp_ch7.adb (Build_Final_List): For an access type that designates a
index d08257e00d6ef253883afd79d82962f6e9798f41..67d9330ae9e12d125dfae8c48319c1c47fadc1c6 100644 (file)
@@ -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);
index 164d4dc91676568e6047e0af11937cfe388fe5a8..b07bb74d687e9b4e99ddf70816bffc48bb01603b 100644 (file)
@@ -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 " &
index b418745c8c3be28ad744c4c5792c6a678bd08228..cbb15d3ac1d2a2914d99db48c1a4a107a6ec8327 100644 (file)
@@ -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;
 
index 1f347a95d24db22ce1cb9de055d04e05863b84de..372f950a9b62739fa1ac57d29cb0a293d9bf6902 100644 (file)
@@ -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
index 0ddc9ced559e5a5bbbea535ab854d05e2cde8c14..4fbc0a783b413d93f7ad7ebe41eb76c8f7a5629d 100644 (file)
@@ -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