exp_ch3.adb, [...]: Minor code reorganization.
authorRobert Dewar <dewar@adacore.com>
Tue, 5 Oct 2010 10:14:50 +0000 (10:14 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Oct 2010 10:14:50 +0000 (12:14 +0200)
2010-10-05  Robert Dewar  <dewar@adacore.com>

* exp_ch3.adb, exp_ch5.adb, exp_disp.adb, exp_dist.adb, gnatlink.adb,
makeutl.adb, par-ch6.adb, prj-dect.adb, prj-env.adb, prj-env.ads,
prj-ext.adb, prj-nmsc.adb, prj-part.adb, prj-pp.ads: Minor code
reorganization.
Minor reformatting.

From-SVN: r164979

15 files changed:
gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch5.adb
gcc/ada/exp_disp.adb
gcc/ada/exp_dist.adb
gcc/ada/gnatlink.adb
gcc/ada/makeutl.adb
gcc/ada/par-ch6.adb
gcc/ada/prj-dect.adb
gcc/ada/prj-env.adb
gcc/ada/prj-env.ads
gcc/ada/prj-ext.adb
gcc/ada/prj-nmsc.adb
gcc/ada/prj-part.adb
gcc/ada/prj-pp.ads

index 1ace8e1e382595ec0413b227917b3de474b33c09..2dee69e3a92491e1a64101a8721d20183d8112a6 100644 (file)
@@ -1,3 +1,11 @@
+2010-10-05  Robert Dewar  <dewar@adacore.com>
+
+       * exp_ch3.adb, exp_ch5.adb, exp_disp.adb, exp_dist.adb, gnatlink.adb,
+       makeutl.adb, par-ch6.adb, prj-dect.adb, prj-env.adb, prj-env.ads,
+       prj-ext.adb, prj-nmsc.adb, prj-part.adb, prj-pp.ads: Minor code
+       reorganization.
+       Minor reformatting.
+
 2010-10-05  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_res.adb (Check_Parameterless_Call): If the prefix of 'Address is
index 93e1dfd02fc6554c0b5db3b6295b6a86c0c0a971..a304c4b14cd2de464d5c901d35252f08a8d5484d 100644 (file)
@@ -4892,8 +4892,8 @@ package body Exp_Ch3 is
                   --            Ityp!(Displace (Temp'Address, I'Tag)).all;
 
                   else
-                     --  Generate the equivalent record type and update
-                     --  the subtype indication to reference it
+                     --  Generate the equivalent record type and update the
+                     --  subtype indication to reference it.
 
                      Expand_Subtype_From_Expr
                        (N             => N,
@@ -4928,7 +4928,7 @@ package body Exp_Ch3 is
                          Expression => New_Expr));
 
                      --  Dynamically reference the tag associated with the
-                     --  interface
+                     --  interface.
 
                      Tag_Comp :=
                        Make_Function_Call (Loc,
@@ -4945,7 +4945,7 @@ package body Exp_Ch3 is
                   Rewrite (N,
                     Make_Object_Renaming_Declaration (Loc,
                       Defining_Identifier => Make_Temporary (Loc, 'D'),
-                      Subtype_Mark => New_Occurrence_Of (Typ, Loc),
+                      Subtype_Mark        => New_Occurrence_Of (Typ, Loc),
                       Name => Convert_Tag_To_Interface (Typ, Tag_Comp)));
 
                   Analyze (N, Suppress => All_Checks);
index 47b15d7ce83d6de1b6a0e5119e3b6793feff112b..9c1c96cef00ad7291bc2e19d0c1ad1deb920b1e7 100644 (file)
@@ -1358,7 +1358,7 @@ package body Exp_Ch5 is
             else
                Expr :=
                  Make_Selected_Component (Loc,
-                   Prefix => Duplicate_Subexpr (Rhs),
+                   Prefix        => Duplicate_Subexpr (Rhs),
                    Selector_Name => New_Occurrence_Of (C, Loc));
             end if;
 
@@ -1366,7 +1366,7 @@ package body Exp_Ch5 is
               Make_Assignment_Statement (Loc,
                 Name =>
                   Make_Selected_Component (Loc,
-                    Prefix => Duplicate_Subexpr (Lhs),
+                    Prefix        => Duplicate_Subexpr (Lhs),
                     Selector_Name =>
                       New_Occurrence_Of (Find_Component (L_Typ, C), Loc)),
                 Expression => Expr);
index 2bbe2ae7995d09832a698818b47ed522a453fddc..b5a464286a303b9cb7af9309b7070bcc5b03df06 100644 (file)
@@ -481,11 +481,11 @@ package body Exp_Disp is
         and then Is_Interface (Typ)
         and then
           ((Nkind (Expr) = N_Selected_Component
-              and then Is_Tag (Entity (Selector_Name (Expr))))
+             and then Is_Tag (Entity (Selector_Name (Expr))))
            or else
            (Nkind (Expr) = N_Function_Call
-              and then RTE_Available (RE_Displace)
-              and then Entity (Name (Expr)) = RTE (RE_Displace))));
+             and then RTE_Available (RE_Displace)
+             and then Entity (Name (Expr)) = RTE (RE_Displace))));
 
       Anon_Type := Create_Itype (E_Anonymous_Access_Type, Expr);
       Set_Directly_Designated_Type (Anon_Type, Typ);
@@ -8023,7 +8023,7 @@ package body Exp_Disp is
             Write_Int (Int (Alias (Prim)));
 
             --  If the DTC_Entity attribute is already set we can also output
-            --  the name of the interface covered by this primitive (if any)
+            --  the name of the interface covered by this primitive (if any).
 
             if Present (DTC_Entity (Alias (Prim)))
               and then Is_Interface (Scope (DTC_Entity (Alias (Prim))))
index 545fda9674792f99efb12e2bb3c2d8e750addec6..36b8c2da92cdcf1b7ba6d8771eb338440ffad51b 100644 (file)
@@ -11044,7 +11044,6 @@ package body Exp_Dist is
             begin
                if Is_Tagged_Type (Typ) and then not Is_Frozen (Typ) then
                   null;
-
                else
                   Serial := Increment_Serial_Number;
                end if;
index b2fcf23e9542acf267d47116c792a3cf2e72a511..bd41b34a66991c47fba73c88dbb3e35f1a4b4be6 100644 (file)
@@ -2001,6 +2001,7 @@ begin
             for J in reverse Linker_Options.First .. Linker_Options.Last loop
 
                --  Remove flags that are not accepted
+
                if Linker_Options.Table (J)'Length = 0
                  or else Linker_Options.Table (J) (1 .. 2) = "-l"
                  or else Linker_Options.Table (J) (1 .. 3) = "-Wl"
index 44adcd4e2f3c32d8a16d3f7670e9eae58deb0c7a..f72e613bc50ee90dbf3b69dfc8dbaffb52453939 100644 (file)
@@ -38,7 +38,7 @@ with Tempdir;
 
 with Ada.Command_Line;  use Ada.Command_Line;
 
-with GNAT.Case_Util; use GNAT.Case_Util;
+with GNAT.Case_Util;            use GNAT.Case_Util;
 with GNAT.Directory_Operations; use GNAT.Directory_Operations;
 with GNAT.HTable;
 
index 17e3f8517e1ad7f5c7d7fa31307415cdedbced5d..3632110601d54ca781e9c5f7483ead6e2bc96148 100644 (file)
@@ -224,8 +224,10 @@ package body Ch6 is
          --  case is for subunits.
 
          if Pf_Flags /= Pf_Decl_Gins_Pbod_Rnam_Stub
-           and then Pf_Flags /= Pf_Decl_Pbod
-           and then Pf_Flags /= Pf_Pbod
+              and then
+            Pf_Flags /= Pf_Decl_Pbod
+              and then
+            Pf_Flags /= Pf_Pbod
          then
             Error_Msg_SC ("overriding indicator not allowed here!");
 
@@ -374,11 +376,12 @@ package body Ch6 is
          end if;
 
       else
-         --  Skip extra parenthesis at end of formal part, and if
-         --  function scan result subtype.
+         --  Skip extra parenthesis at end of formal part
 
          Ignore (Tok_Right_Paren);
 
+         --  For function, scan result subtype
+
          if Func then
             TF_Return;
 
index cd4b2d163a7c29084d34d1870e97eda01b78b344..70f72d963b12e644fe2a1ecfa5f7522a1a882e30 100644 (file)
@@ -179,7 +179,8 @@ package body Prj.Dect is
    procedure Rename_Obsolescent_Attributes
      (In_Tree         : Project_Node_Tree_Ref;
       Attribute       : Project_Node_Id;
-      Current_Package : Project_Node_Id) is
+      Current_Package : Project_Node_Id)
+   is
    begin
       if Present (Current_Package)
         and then Expression_Kind_Of (Current_Package, In_Tree) /= Ignored
@@ -214,7 +215,7 @@ package body Prj.Dect is
       Flags           : Processing_Flags)
    is
       Qualif : constant Project_Qualifier :=
-        Project_Qualifier_Of (Project, In_Tree);
+                 Project_Qualifier_Of (Project, In_Tree);
       Name   : constant Name_Id := Name_Of (Current_Package, In_Tree);
    begin
       if Qualif = Aggregate
@@ -239,8 +240,9 @@ package body Prj.Dect is
       Flags           : Processing_Flags)
    is
       Qualif : constant Project_Qualifier :=
-        Project_Qualifier_Of (Project, In_Tree);
+                 Project_Qualifier_Of (Project, In_Tree);
       Name   : constant Name_Id := Name_Of (Attribute, In_Tree);
+
    begin
       case Qualif is
          when Aggregate =>
@@ -308,6 +310,7 @@ package body Prj.Dect is
 
       procedure Process_Attribute_Name is
          Ignore : Boolean;
+
       begin
          Attribute_Name := Token_Name;
          Set_Name_Of (Attribute, In_Tree, To => Attribute_Name);
index a9e9a8339d3deea98699159d938071c61fe2bca4..f6ae34ca15818be4f2f4efe708b824fb636348b4 100644 (file)
 ------------------------------------------------------------------------------
 
 with Fmap;
-with GNAT.Directory_Operations; use GNAT.Directory_Operations;
 with Hostparm;
-with Makeutl;                   use Makeutl;
+with Makeutl;  use Makeutl;
 with Opt;
-with Osint;                     use Osint;
-with Output;                    use Output;
-with Prj.Com;                   use Prj.Com;
+with Osint;    use Osint;
+with Output;   use Output;
+with Prj.Com;  use Prj.Com;
 with Sdefault;
 with Tempdir;
 
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+
 package body Prj.Env is
 
    Buffer_Initial : constant := 1_000;
@@ -110,9 +111,10 @@ package body Prj.Env is
    --  Project that itself is not extended.
 
    procedure Initialize_Project_Path
-     (Self : in out Project_Search_Path; Target_Name : String);
-   --  Initialize Current_Project_Path.
-   --  Does nothing if the path has already been initialized properly
+     (Self        : in out Project_Search_Path;
+      Target_Name : String);
+   --  Initialize Current_Project_Path. Does nothing if the path has already
+   --  been initialized properly.
 
    ----------------------
    -- Ada_Include_Path --
@@ -1780,7 +1782,8 @@ package body Prj.Env is
    -----------------------------
 
    procedure Initialize_Project_Path
-     (Self : in out Project_Search_Path; Target_Name : String)
+     (Self        : in out Project_Search_Path;
+      Target_Name : String)
    is
       Add_Default_Dir : Boolean := True;
       First           : Positive;
@@ -1801,6 +1804,7 @@ package body Prj.Env is
 
    begin
       --  If already initialized, nothing else to do
+
       if Self.Path /= null
         and then Self.Path (Self.Path'First) /= '#'
       then
index 17d5e48c5775146a04b34c626bfe3f6c3325b7e6..99ae6cee7b8b3c7e24e7d07500de720b3b81c771 100644 (file)
@@ -145,9 +145,9 @@ package Prj.Env is
      (Project : Project_Id;
       In_Tree : Project_Tree_Ref);
    --  Iterate through all the source directories of a project, including those
-   --  of imported or modified projects.
-   --  Only returns those directories that potentially contain Ada sources (ie
-   --  ignore projects that have no Ada sources
+   --  of imported or modified projects. Only returns those directories that
+   --  potentially contain Ada sources (ie ignore projects that have no Ada
+   --  sources
 
    generic
       with procedure Action (Path : String);
@@ -170,11 +170,10 @@ package Prj.Env is
    procedure Add_Directories
      (Self : in out Project_Search_Path;
       Path : String);
-   --  Add one or more directories to the path.
-   --  Directories added with this procedure are added in order after the
-   --  current directory and before the path given by the environment variable
-   --  GPR_PROJECT_PATH. A value of "-" will remove the default project
-   --  directory from the project path.
+   --  Add one or more directories to the path. Directories added with this
+   --  procedure are added in order after the current directory and before the
+   --  path given by the environment variable GPR_PROJECT_PATH. A value of "-"
+   --  will remove the default project directory from the project path.
    --
    --  Calls to this subprogram must be performed before the first call to
    --  Find_Project below, or PATH will be added at the end of the search
@@ -199,13 +198,14 @@ package Prj.Env is
       Directory          : String;
       Path               : out Namet.Path_Name_Type);
    --  Search for a the project with the given name either in Directory (which
-   --  often will be the directory contain the project we are currently
-   --  parsing and which we found a reference to another project), or in the
-   --  project path. Extra_Project_Path contains additional directories to
-   --  search.
+   --  often will be the directory contain the project we are currently parsing
+   --  and which we found a reference to another project), or in the project
+   --  path. Extra_Project_Path contains additional directories to search.
+   --
    --  Project_File_Name can optionally contain directories, and the extension
    --  (.gpr) for the file name is optional.
-   --  Returns No_Name if no such project was found.
+   --
+   --  Returns No_Name if no such project was found
 
 private
    package Projects_Paths is new GNAT.Dynamic_HTables.Simple_HTable
index cb2cca24e576d940fa82aa603dc3a2a96f50b7ea..9c7458e95d48a80e55fe48541f56ea7958428c3a 100644 (file)
@@ -23,8 +23,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Osint;         use Osint;
-with Prj.Tree;      use Prj.Tree;
+with Osint;    use Osint;
+with Prj.Tree; use Prj.Tree;
 
 package body Prj.Ext is
 
index 2a1d90b7e357863cdee3a0705730c79e97a94893..ae0c882da68bdc66909c49f057c320452b942d78 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with GNAT.Case_Util;             use GNAT.Case_Util;
-with GNAT.Directory_Operations;  use GNAT.Directory_Operations;
-with GNAT.Dynamic_HTables;
-with GNAT.Table;
-
 with Err_Vars; use Err_Vars;
 with Opt;      use Opt;
 with Osint;    use Osint;
@@ -45,6 +40,11 @@ with Ada.Strings;                use Ada.Strings;
 with Ada.Strings.Fixed;          use Ada.Strings.Fixed;
 with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants;
 
+with GNAT.Case_Util;            use GNAT.Case_Util;
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+with GNAT.Dynamic_HTables;
+with GNAT.Table;
+
 package body Prj.Nmsc is
 
    No_Continuation_String : aliased String := "";
@@ -4909,7 +4909,7 @@ package body Prj.Nmsc is
 
       Languages : constant Variable_Value :=
                       Prj.Util.Value_Of
-          (Name_Languages, Project.Decl.Attributes, Data.Tree);
+                        (Name_Languages, Project.Decl.Attributes, Data.Tree);
 
       Remove_Source_Dirs : Boolean := False;
 
index cc058b60022410a9b55bc0355e3dea2cca3ee65e..9fb5a06c86c5d8f31e7e5d8c187235cf1d6ddbca 100644 (file)
@@ -509,8 +509,10 @@ package body Prj.Part is
 
       exception
          when Types.Unrecoverable_Error =>
+
             --  Unrecoverable_Error is raised when a line is too long.
             --  A meaningful error message will be displayed later.
+
             Project := Empty_Node;
       end;
 
@@ -535,7 +537,7 @@ package body Prj.Part is
 
          declare
             Declaration : constant Project_Node_Id :=
-              Project_Declaration_Of (Project, In_Tree);
+                            Project_Declaration_Of (Project, In_Tree);
          begin
             Look_For_Virtual_Projects_For
               (Extended_Project_Of (Declaration, In_Tree), In_Tree,
@@ -544,9 +546,9 @@ package body Prj.Part is
 
          --  Now, check the projects directly imported by the main project.
          --  Remove from the potentially virtual any project extended by one
-         --  of these imported projects. For non extending imported
-         --  projects, check that they do not belong to the project tree of
-         --  the project being "extended-all" by the main project.
+         --  of these imported projects. For non extending imported projects,
+         --  check that they do not belong to the project tree of the project
+         --  being "extended-all" by the main project.
 
          declare
             With_Clause : Project_Node_Id;
@@ -930,11 +932,12 @@ package body Prj.Part is
       In_Tree : Project_Node_Tree_Ref;
       Project : Project_Node_Id)
    is
-      With_Clause, Imported : Project_Node_Id;
+      With_Clause : Project_Node_Id;
+      Imported    : Project_Node_Id;
+
    begin
       if not Is_Extending_All (Project, In_Tree) then
          With_Clause := First_With_Clause_Of (Project, In_Tree);
-
          while Present (With_Clause) loop
             Imported := Project_Node_Of (With_Clause, In_Tree);
 
@@ -1174,7 +1177,7 @@ package body Prj.Part is
       end;
 
       if Has_Circular_Dependencies
-        (Flags, Normed_Path_Name, Canonical_Path_Name)
+           (Flags, Normed_Path_Name, Canonical_Path_Name)
       then
          Project := Empty_Node;
          return;
@@ -1641,18 +1644,17 @@ package body Prj.Part is
          Name_Len := Name_Len - 1;
       end loop;
 
-      --  If a dot was found, check if the parent project is imported
-      --  or extended.
+      --  If a dot was found, check if parent project is imported or extended
 
       if Name_Len > 0 then
          Name_Len := Name_Len - 1;
 
          declare
-            Parent_Name  : constant Name_Id := Name_Find;
-            Parent_Found : Boolean := False;
-            Parent_Node  : Project_Node_Id := Empty_Node;
-            With_Clause  : Project_Node_Id :=
-                             First_With_Clause_Of (Project, In_Tree);
+            Parent_Name   : constant Name_Id := Name_Find;
+            Parent_Found  : Boolean := False;
+            Parent_Node   : Project_Node_Id := Empty_Node;
+            With_Clause   : Project_Node_Id :=
+                              First_With_Clause_Of (Project, In_Tree);
             Imp_Proj_Name : Name_Id;
 
          begin
@@ -1670,9 +1672,7 @@ package body Prj.Part is
             Imported_Loop :
             while not Parent_Found and then Present (With_Clause) loop
                Parent_Node := Project_Node_Of (With_Clause, In_Tree);
-
-               Extension_Loop :
-               while Present (Parent_Node) loop
+               Extension_Loop : while Present (Parent_Node) loop
                   Imp_Proj_Name := Name_Of (Parent_Node, In_Tree);
                   Parent_Found := Imp_Proj_Name = Parent_Name;
                   exit Imported_Loop when Parent_Found;
index 85bbdeb82ec6a8218f4ce6b3c2cacfd56bb14ecc..f47e0582b3535733a1cad2828b8fd2331db3f711 100644 (file)
@@ -61,7 +61,7 @@ package Prj.PP is
    --  Output a project file, using either the default output routines, or the
    --  ones specified by W_Char, W_Eol and W_Str.
    --
-   --  Increment is the number of spaces for each indentation level.
+   --  Increment is the number of spaces for each indentation level
    --
    --  W_Char, W_Eol and W_Str can be used to change the default output
    --  procedures. The default values force the output to Standard_Output.
@@ -82,7 +82,7 @@ package Prj.PP is
    --  Id is used to compute the display name of the project including its
    --  proper casing.
    --
-   --  Max_Line_Length is the maximum line length in the project file.
+   --  Max_Line_Length is the maximum line length in the project file
 
 private