sem_util.adb, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Thu, 31 Jul 2014 09:52:57 +0000 (09:52 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2014 09:52:57 +0000 (11:52 +0200)
2014-07-31  Robert Dewar  <dewar@adacore.com>

* sem_util.adb, a-ngelfu.ads, prj-nmsc.adb, prj-conf.adb: Minor
reformatting.

From-SVN: r213332

gcc/ada/ChangeLog
gcc/ada/a-ngelfu.ads
gcc/ada/prj-conf.adb
gcc/ada/prj-nmsc.adb
gcc/ada/sem_util.adb

index eecb3ff2c27f21bd890edbe70e8cebcdbd89c39c..444aed206bac9ce777810adba21e581f3ffd28e1 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-31  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.adb, a-ngelfu.ads, prj-nmsc.adb, prj-conf.adb: Minor
+       reformatting.
+
 2014-07-31  Pascal Obry  <obry@adacore.com>
 
        * prj-nmsc.adb: Minor reformatting.
index 556992322b3d5320260c2920c4cdd2189f0e8106..fba557f5f6129c0e08f618292df14e3ca0cbef76 100644 (file)
@@ -41,20 +41,23 @@ package Ada.Numerics.Generic_Elementary_Functions is
 
    function Sqrt (X : Float_Type'Base) return Float_Type'Base with
      Post => Sqrt'Result >= 0.0
-
        and then (if X = 0.0 then Sqrt'Result = 0.0)
-
        and then (if X = 1.0 then Sqrt'Result = 1.0)
 
-       --  If X is positive, the result of Sqrt is positive. This property is
-       --  useful in particular for static analysis. The property that X is
-       --  positive is not expressed as (X > 0), as the value X may be held in
-       --  registers that have larger range and precision on some architecture
+       --  Finally if X is positive, the result of Sqrt is positive (because
+       --  the sqrt of numbers greater than 1 is greater than or equal to 1,
+       --  and the sqrt of numbers less than 1 is greater than the argument).
+
+       --  This property is useful in particular for static analysis. The
+       --  property that X is positive is not expressed as (X > 0), as
+       --  the value X may be held in registers that have larger range and
+       --  precision on some architecture (for example, on x86 using x387
+       --  FPU, as opposed to SSE2). So, it might be possible for X to be
+       --  2.0**(-5000) or so, which could cause the number to compare as
+       --  greater than 0, but Sqrt would still return a zero result.
 
-       --  (for example, on x86 using x387 FPU, as opposed to SSE2). So, it
-       --  might be possible for X to be 2.0**(-5000) or so, which could cause
-       --  the number to compare as greater than 0, but Sqrt would still return
-       --  a zero result.
+       --  Note: we use the comparison with Succ (0.0) here because this is
+       --  more amenable to CodePeer analysis than the use of 'Machine.
 
        and then (if X >= Float_Type'Succ (0.0) then Sqrt'Result > 0.0);
 
@@ -70,26 +73,26 @@ package Ada.Numerics.Generic_Elementary_Functions is
 
    function "**" (Left, Right : Float_Type'Base) return Float_Type'Base with
      Post => "**"'Result >= 0.0
-               and then (if Right = 0.0 then "**"'Result = 1.0)
-               and then (if Right = 1.0 then "**"'Result = Left)
-               and then (if Left = 1.0 then "**"'Result = 1.0)
-               and then (if Left = 0.0 then "**"'Result = 0.0);
+       and then (if Right = 0.0 then "**"'Result = 1.0)
+       and then (if Right = 1.0 then "**"'Result = Left)
+       and then (if Left  = 1.0 then "**"'Result = 1.0)
+       and then (if Left  = 0.0 then "**"'Result = 0.0);
 
    function Sin (X : Float_Type'Base) return Float_Type'Base with
      Post => Sin'Result in -1.0 .. 1.0
-               and then (if X = 0.0 then Sin'Result = 0.0);
+       and then (if X = 0.0 then Sin'Result = 0.0);
 
    function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base with
      Post => Sin'Result in -1.0 .. 1.0
-               and then (if X = 0.0 then Sin'Result = 0.0);
+       and then (if X = 0.0 then Sin'Result = 0.0);
 
    function Cos (X : Float_Type'Base) return Float_Type'Base with
      Post => Cos'Result in -1.0 .. 1.0
-               and then (if X = 0.0 then Cos'Result = 1.0);
+       and then (if X = 0.0 then Cos'Result = 1.0);
 
    function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base with
      Post => Cos'Result in -1.0 .. 1.0
-               and then (if X = 0.0 then Cos'Result = 1.0);
+       and then (if X = 0.0 then Cos'Result = 1.0);
 
    function Tan (X : Float_Type'Base) return Float_Type'Base with
      Post => (if X = 0.0 then Tan'Result = 0.0);
@@ -144,11 +147,11 @@ package Ada.Numerics.Generic_Elementary_Functions is
 
    function Cosh (X : Float_Type'Base) return Float_Type'Base with
      Post => Cosh'Result >= 1.0
-               and then (if X = 0.0 then Cosh'Result = 1.0);
+       and then (if X = 0.0 then Cosh'Result = 1.0);
 
    function Tanh (X : Float_Type'Base) return Float_Type'Base with
      Post => Tanh'Result in -1.0 .. 1.0
-               and then (if X = 0.0 then Tanh'Result = 0.0);
+       and then (if X = 0.0 then Tanh'Result = 0.0);
 
    function Coth (X : Float_Type'Base) return Float_Type'Base with
      Post => abs Coth'Result >= 1.0;
@@ -158,7 +161,7 @@ package Ada.Numerics.Generic_Elementary_Functions is
 
    function Arccosh (X : Float_Type'Base) return Float_Type'Base with
      Post => Arccosh'Result >= 0.0
-               and then (if X = 1.0 then Arccosh'Result = 0.0);
+       and then (if X = 1.0 then Arccosh'Result = 0.0);
 
    function Arctanh (X : Float_Type'Base) return Float_Type'Base with
      Post => (if X = 0.0 then Arctanh'Result = 0.0);
index b500e7b2f5015fee8ccebf467b247644d53b7c72..c6163fbcad9931366b792145938e1ca99589beb7 100644 (file)
@@ -65,8 +65,8 @@ package body Prj.Conf is
    --  set from a --RTS command line option.
 
    procedure Locate_Runtime
-     (Language     : Name_Id;
-      Env          : Prj.Tree.Environment);
+     (Language : Name_Id;
+      Env      : Prj.Tree.Environment);
    --  If RTS_Name is a base name (a name without path separator), then
    --  do nothing. Otherwise, convert it to an absolute path (possibly by
    --  searching it in the project path) and call Set_Runtime_For with the
@@ -1525,8 +1525,8 @@ package body Prj.Conf is
    --------------------
 
    procedure Locate_Runtime
-     (Language     : Name_Id;
-      Env          : Prj.Tree.Environment)
+     (Language : Name_Id;
+      Env      : Prj.Tree.Environment)
    is
       function Is_Base_Name (Path : String) return Boolean;
       --  Returns True if Path has no directory separator
index 1610aee5e521445925ff00f24dce9c9db9d6fbc6..7d8678aff50dcac681e4d7410d4b69c74d5eb58d 100644 (file)
@@ -3029,30 +3029,34 @@ package body Prj.Nmsc is
       --  Check if an imported or extended project if also a library project
 
       procedure Check_Aggregate_Library_Dirs;
+      --  Check that the library directory and the library ALI directory of
+      --  an aggregate library project are not the same as the object directory
+      --  or the library directory of any of its aggregated projects.
 
       ----------------------------------
       -- Check_Aggregate_Library_Dirs --
       ----------------------------------
 
       procedure Check_Aggregate_Library_Dirs is
-
          procedure Process_Aggregate (Proj : Project_Id);
+         --  Recursive procedure to check the aggregated projects, as they may
+         --  also be aggregated library projects.
 
          -----------------------
          -- Process_Aggregate --
          -----------------------
 
          procedure Process_Aggregate (Proj : Project_Id) is
-
-            Agg : Aggregated_Project_List := Proj.Aggregated_Projects;
+            Agg : Aggregated_Project_List;
 
          begin
+            Agg := Proj.Aggregated_Projects;
             while Agg /= null loop
                Error_Msg_Name_1 := Agg.Project.Name;
 
-               if Agg.Project.Qualifier /= Aggregate_Library and then
-                 Project.Library_ALI_Dir.Name
-                 = Agg.Project.Object_Directory.Name
+               if Agg.Project.Qualifier /= Aggregate_Library
+                 and then Project.Library_ALI_Dir.Name =
+                                        Agg.Project.Object_Directory.Name
                then
                   Error_Msg
                     (Data.Flags,
@@ -3060,8 +3064,8 @@ package body Prj.Nmsc is
                      & " object directory of aggregated project %%",
                      The_Lib_Kind.Location, Project);
 
-               elsif Project.Library_ALI_Dir.Name
-                 = Agg.Project.Library_Dir.Name
+               elsif Project.Library_ALI_Dir.Name =
+                                        Agg.Project.Library_Dir.Name
                then
                   Error_Msg
                     (Data.Flags,
@@ -3069,9 +3073,9 @@ package body Prj.Nmsc is
                      & " library directory of aggregated project %%",
                      The_Lib_Kind.Location, Project);
 
-               elsif Agg.Project.Qualifier /= Aggregate_Library and then
-                 Project.Library_Dir.Name
-                 = Agg.Project.Object_Directory.Name
+               elsif Agg.Project.Qualifier /= Aggregate_Library
+                 and then Project.Library_Dir.Name =
+                                        Agg.Project.Object_Directory.Name
                then
                   Error_Msg
                     (Data.Flags,
@@ -3079,8 +3083,8 @@ package body Prj.Nmsc is
                      & " object directory of aggregated project %%",
                      The_Lib_Kind.Location, Project);
 
-               elsif Project.Library_Dir.Name
-                 = Agg.Project.Library_Dir.Name
+               elsif Project.Library_Dir.Name =
+                                        Agg.Project.Library_Dir.Name
                then
                   Error_Msg
                     (Data.Flags,
@@ -3097,6 +3101,8 @@ package body Prj.Nmsc is
             end loop;
          end Process_Aggregate;
 
+      --  Start of processing for Check_Aggregate_Library_Dirs
+
       begin
          if Project.Qualifier = Aggregate_Library then
             Process_Aggregate (Project);
index f6c150f0759ec38bdba0eced6904082a4e2ea24b..8f24046042a1de33a3104fc5297333fb6d1c2d38 100644 (file)
@@ -16459,7 +16459,6 @@ package body Sem_Util is
          Stmt := Original_Node (N);
       end if;
 
-      --    and then Ekind (Entity (Identifier (Stmt))) = E_Loop
       return
         Nkind (Stmt) = N_Loop_Statement
           and then Present (Identifier (Stmt))