[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 18 Apr 2016 12:58:22 +0000 (14:58 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 18 Apr 2016 12:58:22 +0000 (14:58 +0200)
2016-04-18  Arnaud Charlet  <charlet@adacore.com>

* einfo.adb (Overridden_Operation): assert that
function is called for valid arguments.
* sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
No space after closing parenthesis except where required for
layout.
* sem_res.adb: Minor reformatting.

2016-04-18  Arnaud Charlet  <charlet@adacore.com>

* exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
statement when relevant.

2016-04-18  Bob Duff  <duff@adacore.com>

* a-cuprqu.adb (Enqueue): Properly handle the
case where the new element has a unique priority.

2016-04-18  Tristan Gingold  <gingold@adacore.com>

* adaint.h: Define stat structures and functions for iOS
simulator.

From-SVN: r235146

27 files changed:
gcc/ada/ChangeLog
gcc/ada/a-chtgbo.ads
gcc/ada/a-chtgop.ads
gcc/ada/a-cofove.adb
gcc/ada/a-cuprqu.adb
gcc/ada/a-ngcefu.adb
gcc/ada/adaint.h
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch6.adb
gcc/ada/freeze.adb
gcc/ada/i-cobol.ads
gcc/ada/par-ch5.adb
gcc/ada/s-bignum.adb
gcc/ada/s-osinte-vxworks.ads
gcc/ada/s-rannum.adb
gcc/ada/sem.adb
gcc/ada/sem_aggr.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb
gcc/ada/sem_type.adb
gcc/ada/sem_util.adb

index 47029de63f0675969b30776c369403fe7efd8e55..cc95c820b1342864a227e68859f14c0c9caaa776 100644 (file)
@@ -1,3 +1,31 @@
+2016-04-18  Arnaud Charlet  <charlet@adacore.com>
+
+       * einfo.adb (Overridden_Operation): assert that
+       function is called for valid arguments.
+       * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb,
+       s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads,
+       sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb,
+       sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb,
+       s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb:
+       No space after closing parenthesis except where required for
+       layout.
+       * sem_res.adb: Minor reformatting.
+
+2016-04-18  Arnaud Charlet  <charlet@adacore.com>
+
+       * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case
+       statement when relevant.
+
+2016-04-18  Bob Duff  <duff@adacore.com>
+
+       * a-cuprqu.adb (Enqueue): Properly handle the
+       case where the new element has a unique priority.
+
+2016-04-18  Tristan Gingold  <gingold@adacore.com>
+
+       * adaint.h: Define stat structures and functions for iOS
+       simulator.
+
 2016-04-18  Arnaud Charlet  <charlet@adacore.com>
 
        * sem_res.adb (Resolve_Entry_Call): reset
index 892bdaaf1dffc163ed98ba56bb18ed2cb2c65e92..184cefc4d83b961cb5ab2b3e7206d448e26114dc 100644 (file)
@@ -81,7 +81,7 @@ package Ada.Containers.Hash_Tables.Generic_Bounded_Operations is
 
    procedure Clear (HT : in out Hash_Table_Type'Class);
    --  Deallocates each node in hash table HT. (Note that it only deallocates
-   --  the nodes, not the buckets array.)  Program_Error is raised if the hash
+   --  the nodes, not the buckets array.) Program_Error is raised if the hash
    --  table is busy.
 
    procedure Delete_Node_At_Index
index 4a7fbd6c7438f241840cbd40b407503bbd18fcfe..1b865dcbd29f096c4aa8d4f2396a181e9c8146a7 100644 (file)
@@ -107,7 +107,7 @@ package Ada.Containers.Hash_Tables.Generic_Operations is
 
    procedure Clear (HT : in out Hash_Table_Type);
    --  Deallocates each node in hash table HT. (Note that it only deallocates
-   --  the nodes, not the buckets array.)  Program_Error is raised if the hash
+   --  the nodes, not the buckets array.) Program_Error is raised if the hash
    --  table is busy.
 
    procedure Move (Target, Source : in out Hash_Table_Type);
index ac8208593b62d446b67014664277d54fc87956c8..529a73b9e25ad252d1ee8d889e506bf05a17cd79 100644 (file)
@@ -95,7 +95,7 @@ is
 
    procedure Append (Container : in out Vector; New_Item : Vector) is
    begin
-      for X in First_Index (New_Item) .. Last_Index (New_Item)  loop
+      for X in First_Index (New_Item) .. Last_Index (New_Item) loop
          Append (Container, Element (New_Item, X));
       end loop;
    end Append;
@@ -119,7 +119,7 @@ is
          raise Constraint_Error with "vector is already at its maximum length";
       end if;
 
-      --  TODO: should check whether length > max capacity (cnt_t'last)  ???
+      --  TODO: should check whether length > max capacity (cnt_t'last) ???
 
       Container.Last := Container.Last + 1;
       Elems (Container) (Length (Container)) := New_Item;
index 7502aa97cd8235b5a16da575a92aac3c1f09142c..5fb74cc098ff6639d81e8b4a093bf089fb8b5cf4 100644 (file)
@@ -194,6 +194,15 @@ package body Ada.Containers.Unbounded_Priority_Queues is
             --  must update.
 
             List.Header.Next_Unequal := Node;
+
+         elsif Before (Get_Priority (Prev.Element), P) then
+
+            --  If the new item inserted has a unique priority in queue (not
+            --  same priority as precedent), set Next_Unequal of precedent
+            --  element to the new element instead of old next element, since
+            --  Before (P, Get_Priority (Next.Element) or Next = H).
+
+            Prev.Next_Unequal := Node;
          end if;
 
          pragma Assert (List.Header.Next_Unequal = List.Header.Next);
index 87a1dc9e1604d6a646851b72924774be4ecdd00d..abe7e3dac6d1a765a8f4860aaee8e7fa00b9233c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2013, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2015, Free Software Foundation, Inc.         --
 --                                                                          --
 -- 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- --
@@ -78,7 +78,7 @@ package body Ada.Numerics.Generic_Complex_Elementary_Functions is
       elsif Re (Left) = 0.0 and then Im (Left) = 0.0 then
          return Left;
 
-      elsif Right = (0.0, 0.0)  then
+      elsif Right = (0.0, 0.0) then
          return Complex_One;
 
       elsif Re (Right) = 0.0 and then Im (Right) = 0.0 then
@@ -417,7 +417,7 @@ package body Ada.Numerics.Generic_Complex_Elementary_Functions is
    begin
       return
         Compose_From_Cartesian
-          (Cos (Re (X))  * Cosh (Im (X)),
+          (Cos (Re (X)) * Cosh (Im (X)),
            -(Sin (Re (X)) * Sinh (Im (X))));
    end Cos;
 
index 5df192677c57f2f98ff4b7412b4aa49b64e47513..2559a31ea8455e9ca6179abcbacac2ae1c600480 100644 (file)
@@ -67,6 +67,30 @@ extern "C" {
 #define GNAT_LSTAT lstat
 #define GNAT_STRUCT_STAT struct stat64
 
+#elif defined(__APPLE__)
+
+# include <TargetConditionals.h>
+
+# if TARGET_IPHONE_SIMULATOR
+  /* On iOS (simulator or not), the stat structure is the 64 bit one.
+     But the simulator uses the MacOS X syscalls that aren't 64 bit.
+     Fix this interfacing issue here.  */
+    int fstat64(int, struct stat *);
+    int stat64(const char *, struct stat *);
+    int lstat64(const char *, struct stat *);
+#   define GNAT_STAT stat64
+#   define GNAT_FSTAT fstat64
+#   define GNAT_LSTAT lstat64
+# else
+#   define GNAT_STAT stat
+#   define GNAT_FSTAT fstat
+#   define GNAT_LSTAT lstat
+# endif
+
+#   define GNAT_FOPEN fopen
+#   define GNAT_OPEN open
+#   define GNAT_STRUCT_STAT struct stat
+
 #else
 #define GNAT_FOPEN fopen
 #define GNAT_OPEN open
index a43bff5bf0786cf2c22cd0ba8050138a2a575b2e..e0a9b174d076dec0d3bb5526f335e234c7bf4748 100644 (file)
@@ -2365,13 +2365,13 @@ package body Einfo is
 
    function Is_Predicate_Function (Id : E) return B is
    begin
-      pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
       return Flag255 (Id);
    end Is_Predicate_Function;
 
    function Is_Predicate_Function_M (Id : E) return B is
    begin
-      pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
       return Flag256 (Id);
    end Is_Predicate_Function_M;
 
@@ -2835,6 +2835,7 @@ package body Einfo is
 
    function Overridden_Operation (Id : E) return E is
    begin
+      pragma Assert (Is_Subprogram (Id) or else Is_Generic_Subprogram (Id));
       return Node26 (Id);
    end Overridden_Operation;
 
@@ -5393,13 +5394,13 @@ package body Einfo is
 
    procedure Set_Is_Predicate_Function (Id : E; V : B := True) is
    begin
-      pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
       Set_Flag255 (Id, V);
    end Set_Is_Predicate_Function;
 
    procedure Set_Is_Predicate_Function_M (Id : E; V : B := True) is
    begin
-      pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
+      pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
       Set_Flag256 (Id, V);
    end Set_Is_Predicate_Function_M;
 
index 76520c8d1899e9021c94d8df24b820cbe644dcb5..e0b1f26d677a6c8ecce0af30af6845bf27886023 100644 (file)
@@ -3385,7 +3385,7 @@ package Einfo is
 
 --    Needs_No_Actuals (Flag22)
 --       Defined in callable entities (subprograms, entries, access to
---       subprograms)  which can be called without actuals because all of
+--       subprograms) which can be called without actuals because all of
 --       their formals (if any) have default values. This flag simplifies the
 --       resolution of the syntactic ambiguity involving a call to these
 --       entities when the return type is an array type, and a call can be
@@ -4471,7 +4471,7 @@ package Einfo is
 --  The flag Has_Delayed_Freeze indicates that an entity carries an explicit
 --  freeze node, which appears later in the expanded tree.
 
---  a)   The flag is used by the front-end to trigger expansion actions
+--  a) The flag is used by the front-end to trigger expansion actions
 --  which include the generation of that freeze node. Typically this happens at
 --  the end of the current compilation unit, or before the first subprogram
 --  body is encountered in the current unit. See files freeze and exp_ch13 for
@@ -4479,7 +4479,7 @@ package Einfo is
 --  construction of initialization procedures and dispatch tables.
 
 --  b) The flag is used by the backend to defer elaboration of the entity until
---  its freeze node is seen.  In the absence of an explicit freeze node, an
+--  its freeze node is seen. In the absence of an explicit freeze node, an
 --  entity is frozen (and elaborated) at the point of declaration.
 
 --  For object declarations, the flag is set when an address clause for the
index 2832d615c76588ce801be4a9eea4b8bbe562d13d..3a323b3840bea2ce58c57f3b95ded688d3ddf09b 100644 (file)
@@ -4845,16 +4845,19 @@ package body Exp_Ch4 is
    ------------------------------
 
    procedure Expand_N_Case_Expression (N : Node_Id) is
-      Loc     : constant Source_Ptr := Sloc (N);
-      Typ     : constant Entity_Id  := Etype (N);
-      Cstmt   : Node_Id;
-      Decl    : Node_Id;
-      Tnn     : Entity_Id;
-      Pnn     : Entity_Id;
-      Actions : List_Id;
-      Ttyp    : Entity_Id;
-      Alt     : Node_Id;
-      Fexp    : Node_Id;
+      Loc                  : constant Source_Ptr := Sloc (N);
+      Typ                  : constant Entity_Id  := Etype (N);
+      Acts                 : List_Id;
+      Alt                  : Node_Id;
+      Case_Stmt            : Node_Id;
+      Decl                 : Node_Id;
+      Expr                 : Node_Id;
+      In_Predicate         : Boolean := False;
+      Optimize_Return_Stmt : Boolean := False;
+      Par                  : Node_Id;
+      Ptr_Typ              : Entity_Id;
+      Target               : Entity_Id;
+      Target_Typ           : Entity_Id;
 
    begin
       --  Check for MINIMIZED/ELIMINATED overflow mode
@@ -4870,10 +4873,13 @@ package body Exp_Ch4 is
 
       if Ekind_In (Current_Scope, E_Function, E_Procedure)
         and then Is_Predicate_Function (Current_Scope)
-        and then
-          Has_Static_Predicate_Aspect (Etype (First_Entity (Current_Scope)))
       then
-         return;
+         In_Predicate := True;
+
+         if Has_Static_Predicate_Aspect (Etype (First_Entity (Current_Scope)))
+         then
+            return;
+         end if;
       end if;
 
       --  We expand
@@ -4883,35 +4889,54 @@ package body Exp_Ch4 is
       --  to
 
       --    do
-      --       Tnn : typ;
+      --       Target : typ;
       --       case X is
       --          when A =>
-      --             Tnn := AX;
+      --             Target := AX;
       --          when B =>
-      --             Tnn := BX;
+      --             Target := BX;
       --          ...
       --       end case;
-      --    in Tnn end;
+      --    in Target end;
+
+      --  Except when the case expression appears as part of a simple return
+      --  statement, returning an elementary type, where we expand
 
-      --  However, this expansion is wrong for limited types, and also
-      --  wrong for unconstrained types (since the bounds may not be the
-      --  same in all branches). Furthermore it involves an extra copy
-      --  for large objects. So we take care of this by using the following
-      --  modified expansion for non-elementary types:
+      --    return (case X is when A => AX, when B => BX ...)
+
+      --  to
+
+      --    case X is
+      --       when A =>
+      --          return AX;
+      --       when B =>
+      --          return BX;
+      --       ...
+      --    end case;
+
+      --    Note that this expansion is also triggered for expression functions
+      --    containing a single case expression since these functions are
+      --    expanded as above.
+
+      --  However, this expansion is wrong for limited types, and also wrong
+      --  for unconstrained types (since the bounds may not be the same in all
+      --  branches). Furthermore it involves an extra copy for large objects.
+      --  So we take care of this by using the following modified expansion for
+      --  non-elementary types:
 
       --    do
-      --       type Pnn is access all typ;
-      --       Tnn : Pnn;
+      --       type Ptr_Typ is access all typ;
+      --       Target : Ptr_Typ;
       --       case X is
       --          when A =>
-      --             T := AX'Unrestricted_Access;
+      --             Target := AX'Unrestricted_Access;
       --          when B =>
-      --             T := BX'Unrestricted_Access;
+      --             Target := BX'Unrestricted_Access;
       --          ...
       --       end case;
-      --    in Tnn.all end;
+      --    in Target.all end;
 
-      Cstmt :=
+      Case_Stmt :=
         Make_Case_Statement (Loc,
           Expression   => Expression (N),
           Alternatives => New_List);
@@ -4921,99 +4946,126 @@ package body Exp_Ch4 is
       --  the premature finalization of controlled objects found within the
       --  case statement.
 
-      Set_From_Conditional_Expression (Cstmt);
-
-      Actions := New_List;
+      Set_From_Conditional_Expression (Case_Stmt);
+      Acts := New_List;
 
       --  Scalar case
 
       if Is_Elementary_Type (Typ) then
-         Ttyp := Typ;
+         Target_Typ := Typ;
+
+         --  ??? Do not perform the optimization when the return statement is
+         --  within a predicate function as this causes supurious errors. A
+         --  possible mismatch in handling this case somewhere else in semantic
+         --  analysis?
+
+         if not In_Predicate
+           and then Nkind (Parent (N)) = N_Simple_Return_Statement
+         then
+            Optimize_Return_Stmt := True;
+         end if;
 
       else
-         Pnn := Make_Temporary (Loc, 'P');
-         Append_To (Actions,
+         Ptr_Typ := Make_Temporary (Loc, 'P');
+         Append_To (Acts,
            Make_Full_Type_Declaration (Loc,
-             Defining_Identifier => Pnn,
+             Defining_Identifier => Ptr_Typ,
              Type_Definition     =>
                Make_Access_To_Object_Definition (Loc,
                  All_Present        => True,
                  Subtype_Indication => New_Occurrence_Of (Typ, Loc))));
-         Ttyp := Pnn;
+         Target_Typ := Ptr_Typ;
       end if;
 
-      Tnn := Make_Temporary (Loc, 'T');
+      if not Optimize_Return_Stmt then
+         Target := Make_Temporary (Loc, 'T');
 
-      --  Create declaration for target of expression, and indicate that it
-      --  does not require initialization.
+         --  Create declaration for target of expression, and indicate that it
+         --  does not require initialization.
 
-      Decl :=
-        Make_Object_Declaration (Loc,
-          Defining_Identifier => Tnn,
-          Object_Definition   => New_Occurrence_Of (Ttyp, Loc));
-      Set_No_Initialization (Decl);
-      Append_To (Actions, Decl);
+         Decl :=
+           Make_Object_Declaration (Loc,
+             Defining_Identifier => Target,
+             Object_Definition   => New_Occurrence_Of (Target_Typ, Loc));
+         Set_No_Initialization (Decl);
+         Append_To (Acts, Decl);
+      end if;
 
       --  Now process the alternatives
 
       Alt := First (Alternatives (N));
       while Present (Alt) loop
          declare
-            Aexp  : Node_Id             := Expression (Alt);
-            Aloc  : constant Source_Ptr := Sloc (Aexp);
-            Stats : List_Id;
+            Alt_Expr : Node_Id             := Expression (Alt);
+            Alt_Loc  : constant Source_Ptr := Sloc (Alt_Expr);
+            Stmts    : List_Id;
 
          begin
             --  As described above, take Unrestricted_Access for case of non-
             --  scalar types, to avoid big copies, and special cases.
 
             if not Is_Elementary_Type (Typ) then
-               Aexp :=
-                 Make_Attribute_Reference (Aloc,
-                   Prefix         => Relocate_Node (Aexp),
+               Alt_Expr :=
+                 Make_Attribute_Reference (Alt_Loc,
+                   Prefix         => Relocate_Node (Alt_Expr),
                    Attribute_Name => Name_Unrestricted_Access);
             end if;
 
-            Stats := New_List (
-              Make_Assignment_Statement (Aloc,
-                Name       => New_Occurrence_Of (Tnn, Loc),
-                Expression => Aexp));
+            if Optimize_Return_Stmt then
+               Stmts := New_List (
+                 Make_Simple_Return_Statement (Alt_Loc,
+                   Expression => Alt_Expr));
+            else
+               Stmts := New_List (
+                 Make_Assignment_Statement (Alt_Loc,
+                   Name       => New_Occurrence_Of (Target, Loc),
+                   Expression => Alt_Expr));
+            end if;
 
             --  Propagate declarations inserted in the node by Insert_Actions
             --  (for example, temporaries generated to remove side effects).
             --  These actions must remain attached to the alternative, given
             --  that they are generated by the corresponding expression.
 
-            if Present (Sinfo.Actions (Alt)) then
-               Prepend_List (Sinfo.Actions (Alt), Stats);
+            if Present (Actions (Alt)) then
+               Prepend_List (Actions (Alt), Stmts);
             end if;
 
             Append_To
-              (Alternatives (Cstmt),
+              (Alternatives (Case_Stmt),
                Make_Case_Statement_Alternative (Sloc (Alt),
                  Discrete_Choices => Discrete_Choices (Alt),
-                 Statements       => Stats));
+                 Statements       => Stmts));
          end;
 
          Next (Alt);
       end loop;
 
-      Append_To (Actions, Cstmt);
+      --  Rewrite parent return statement as a case statement if possible
+
+      if Optimize_Return_Stmt then
+         Par := Parent (N);
+         Rewrite (Par, Case_Stmt);
+         Analyze (Par);
+         return;
+      end if;
+
+      Append_To (Acts, Case_Stmt);
 
       --  Construct and return final expression with actions
 
       if Is_Elementary_Type (Typ) then
-         Fexp := New_Occurrence_Of (Tnn, Loc);
+         Expr := New_Occurrence_Of (Target, Loc);
       else
-         Fexp :=
+         Expr :=
            Make_Explicit_Dereference (Loc,
-             Prefix => New_Occurrence_Of (Tnn, Loc));
+             Prefix => New_Occurrence_Of (Target, Loc));
       end if;
 
       Rewrite (N,
         Make_Expression_With_Actions (Loc,
-          Expression => Fexp,
-          Actions    => Actions));
+          Expression => Expr,
+          Actions    => Acts));
 
       Analyze_And_Resolve (N, Typ);
    end Expand_N_Case_Expression;
index b1d4293146caa8a894124896acf8e82dfdacb410..704a5c04dd328dd38148837676638a84826d1480 100644 (file)
@@ -3707,7 +3707,7 @@ package body Exp_Ch6 is
                  Make_Explicit_Dereference (Loc,
                    Prefix => Nam);
 
-               if Present (Parameter_Associations (Call_Node))  then
+               if Present (Parameter_Associations (Call_Node)) then
                   Parm := Parameter_Associations (Call_Node);
                else
                   Parm := New_List;
@@ -3790,7 +3790,7 @@ package body Exp_Ch6 is
                 (RTE (RE_Address), Relocate_Node (First_Actual (Call_Node))));
             return;
 
-         elsif Is_Null_Procedure (Subp)  then
+         elsif Is_Null_Procedure (Subp) then
             Rewrite (Call_Node, Make_Null_Statement (Loc));
             return;
          end if;
index 556c23adbd4c56bc940b886b5a7b19995f34564c..dd91f8028a12c5fed20ec12bd20de4839568528a 100644 (file)
@@ -8318,7 +8318,7 @@ package body Freeze is
          --  Add friendly warning if initialization comes from a packed array
          --  component.
 
-         if Is_Record_Type (Typ)  then
+         if Is_Record_Type (Typ) then
             declare
                Comp : Entity_Id;
 
index ad885e4a91a9fa6ba381fa1b39c09db791208b2a..9edcc0194da8ccd556b01e28676f3fe71c7e962f 100644 (file)
@@ -7,7 +7,7 @@
 --                                 S p e c                                  --
 --                             (ASCII Version)                              --
 --                                                                          --
---          Copyright (C) 1993-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1993-2015, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -439,8 +439,8 @@ package Interfaces.COBOL is
       function To_Decimal (Item : Binary)      return Num;
       function To_Decimal (Item : Long_Binary) return Num;
 
-      function To_Binary      (Item : Num)  return Binary;
-      function To_Long_Binary (Item : Num)  return Long_Binary;
+      function To_Binary      (Item : Num) return Binary;
+      function To_Long_Binary (Item : Num) return Long_Binary;
 
    private
       pragma Inline (Length);
index a7d0e5a3d7bedfc8f85dd0f0aa862870e99286cf..1aecca6b12d7f08d24d4b3d5f64937cb245d57ea 100644 (file)
@@ -42,7 +42,7 @@ package body Ch5 is
    function P_Label                              return Node_Id;
    function P_Null_Statement                     return Node_Id;
 
-   function P_Assignment_Statement (LHS : Node_Id)  return Node_Id;
+   function P_Assignment_Statement (LHS : Node_Id) return Node_Id;
    --  Parse assignment statement. On entry, the caller has scanned the left
    --  hand side (passed in as Lhs), and the colon-equal (or some symbol
    --  taken to be an error equivalent such as equal).
index 0c20a5b95203fc3e1694ddc51225580e0daf277e..18f62c7d2359e6cad72d806705f58fdb1b68c5ff 100644 (file)
@@ -147,7 +147,7 @@ package body System.Bignums is
                for J in reverse 1 .. X'Last loop
                   RD := RD + DD (X (J));
 
-                  if J >= 1 + (X'Last - Y'Last)  then
+                  if J >= 1 + (X'Last - Y'Last) then
                      RD := RD + DD (Y (J - (X'Last - Y'Last)));
                   end if;
 
@@ -189,7 +189,7 @@ package body System.Bignums is
                   for J in reverse 1 .. X'Last loop
                      RD := RD + DD (X (J));
 
-                     if J >= 1 + (X'Last - Y'Last)  then
+                     if J >= 1 + (X'Last - Y'Last) then
                         RD := RD - DD (Y (J - (X'Last - Y'Last)));
                      end if;
 
@@ -840,9 +840,9 @@ package body System.Bignums is
 
                Carry := 0;
                for J in reverse 1 .. n loop
-                  Tmp    := DD (v (J)) * d + Carry;
-                  v (J)  := LSD (Tmp);
-                  Carry  := Tmp / Base;
+                  Tmp   := DD (v (J)) * d + Carry;
+                  v (J) := LSD (Tmp);
+                  Carry := Tmp / Base;
                end loop;
 
                pragma Assert (Carry = 0);
index ba76dcdf3471115da741650eff8917fb587a4101..0129b593b0f5664180172207cbc865c3f88b03d0 100644 (file)
@@ -284,7 +284,7 @@ package System.OS_Interface is
    OK    : constant STATUS := 0;
    ERROR : constant STATUS := Interfaces.C.int (-1);
 
-   function taskIdVerify (tid : t_id)  return STATUS;
+   function taskIdVerify (tid : t_id) return STATUS;
    pragma Import (C, taskIdVerify, "taskIdVerify");
 
    function taskIdSelf return t_id;
index acebbaf8a6b9badbea28ed98974a5358ecf6bd4b..c024249ad09e0fa05d280fbf130a66bb1cb7e9bf 100644 (file)
@@ -208,7 +208,7 @@ is
       G.I := I;
 
       Y := Y xor Shift_Right (Y, U);
-      Y := Y xor (Shift_Left (Y, S)  and B_Mask);
+      Y := Y xor (Shift_Left (Y, S) and B_Mask);
       Y := Y xor (Shift_Left (Y, T) and C_Mask);
       Y := Y xor Shift_Right (Y, L);
 
index f6f4a91b43f06903a1ce7a41ddd8707c430040e3..a6061ead8c5605b9cd78f40e648d2aa828976956 100644 (file)
@@ -2039,7 +2039,7 @@ package body Sem is
                --  The flag Withed_Body on a context clause indicates that a
                --  unit contains an instantiation that may be needed later,
                --  and therefore the body that contains the generic body (and
-               --  its context)  must be traversed immediately after the
+               --  its context) must be traversed immediately after the
                --  corresponding spec (see Do_Unit_And_Dependents).
 
                --  The main unit itself is processed separately after all other
index 4657336e726bba1efc277243e9674787bfc6b068..25022e95a9e947bce05f4958b1949862c3093f0c 100644 (file)
@@ -479,7 +479,7 @@ package body Sem_Aggr is
          else
             if Compile_Time_Known_Value (This_Low) then
                if not Compile_Time_Known_Value (Aggr_Low (Dim)) then
-                  Aggr_Low (Dim)  := This_Low;
+                  Aggr_Low (Dim) := This_Low;
 
                elsif Expr_Value (This_Low) /= Expr_Value (Aggr_Low (Dim)) then
                   Set_Raises_Constraint_Error (N);
@@ -491,7 +491,7 @@ package body Sem_Aggr is
 
             if Compile_Time_Known_Value (This_High) then
                if not Compile_Time_Known_Value (Aggr_High (Dim)) then
-                  Aggr_High (Dim)  := This_High;
+                  Aggr_High (Dim) := This_High;
 
                elsif
                  Expr_Value (This_High) /= Expr_Value (Aggr_High (Dim))
@@ -1842,7 +1842,7 @@ package body Sem_Aggr is
             Errors_Posted_On_Choices : Boolean := False;
             --  Keeps track of whether any choices have semantic errors
 
-            function Empty_Range (A : Node_Id)  return Boolean;
+            function Empty_Range (A : Node_Id) return Boolean;
             --  If an association covers an empty range, some warnings on the
             --  expression of the association can be disabled.
 
@@ -1850,7 +1850,7 @@ package body Sem_Aggr is
             -- Empty_Range --
             -----------------
 
-            function Empty_Range (A : Node_Id)  return Boolean is
+            function Empty_Range (A : Node_Id) return Boolean is
                R : constant Node_Id := First (Choices (A));
             begin
                return No (Next (R))
index 022edfe03e3fc250da5674ae374094903c099067..53ff828d20c9f318a5b5688fbce521644dd93b26 100644 (file)
@@ -879,7 +879,7 @@ package body Sem_Ch10 is
       end if;
 
       --  All components of the context: with-clauses, library unit, ancestors
-      --  if any, (and their context)  are analyzed and installed.
+      --  if any, (and their context) are analyzed and installed.
 
       --  Call special debug routine sm if this is the main unit
 
index 5508c9b9eda62b0207241ac9bb3cf95f82f6656f..125b877e6d975fa930ae40a095de458deb73b150 100644 (file)
@@ -1324,7 +1324,7 @@ package body Sem_Ch12 is
       -- Process_Default --
       ---------------------
 
-      procedure Process_Default (F : Entity_Id)  is
+      procedure Process_Default (F : Entity_Id) is
          Loc     : constant Source_Ptr := Sloc (I_Node);
          F_Id    : constant Entity_Id  := Defining_Entity (F);
          Decl    : Node_Id;
index 56e8a74f2bff9c7040b387d6076a4816eaf961c9..f41b8e99b0c8f65fcca36078e2e930e5345f8fc9 100644 (file)
@@ -3168,7 +3168,7 @@ package body Sem_Ch3 is
          end loop;
       end if;
 
-      if Is_Integer_Type (T)  then
+      if Is_Integer_Type (T) then
          Resolve (E, T);
          Set_Etype (Id, Universal_Integer);
          Set_Ekind (Id, E_Named_Integer);
@@ -14522,7 +14522,7 @@ package body Sem_Ch3 is
             --  of the derived type are not relevant, and thus we can use
             --  the base type for the formals. However, the return type may be
             --  used in a context that requires that the proper static bounds
-            --  be used (a case statement, for example)  and for those cases
+            --  be used (a case statement, for example) and for those cases
             --  we must use the derived type (first subtype), not its base.
 
             --  If the derived_type_definition has no constraints, we know that
index 62eea8c6cd9d545385410bf6d1b677d31729f2bc..657a0e45dfadfb7956fade394bd384c22cd906bf 100644 (file)
@@ -803,7 +803,7 @@ package body Sem_Ch5 is
          Set_Referenced_Modified (Lhs, Out_Param => False);
       end if;
 
-      --  RM 7.3.2 (12/3)  An assignment to a view conversion (from a type
+      --  RM 7.3.2 (12/3): An assignment to a view conversion (from a type
       --  to one of its ancestors) requires an invariant check. Apply check
       --  only if expression comes from source, otherwise it will be applied
       --  when value is assigned to source entity.
index 27a44d8cc5b5fbc8cff310f4d447ff7d27390558..8e27d80f79f7cdb7cc309bb8f8272d8a90dee83c 100644 (file)
@@ -4652,7 +4652,7 @@ package body Sem_Prag is
                then
                   OK := True;
 
-               --  If the aspect is a predicate (possibly others ???)  and the
+               --  If the aspect is a predicate (possibly others ???) and the
                --  context is a record type, this is a discriminant expression
                --  within a type declaration, that freezes the predicated
                --  subtype.
index 1dfa862b3df79bf79178838054a0f3b8a7cc7319..5a6d39252735a90db88d88cda36f0b5619b9eea8 100644 (file)
@@ -7657,14 +7657,15 @@ package body Sem_Res is
 
          --  Reset the Is_Overloaded flag, since resolution is now completed
 
+         --  Simple entry call
+
          if Nkind (Entry_Name) = N_Selected_Component then
-            --  Simple entry call
             Set_Is_Overloaded (Selector_Name (Entry_Name), False);
 
+         --  Call to a member of an entry family
+
          else pragma Assert (Nkind (Entry_Name) = N_Indexed_Component);
-            --  Call to member of entry family
             Set_Is_Overloaded (Selector_Name (Prefix (Entry_Name)), False);
-
          end if;
       end if;
 
index 131beb900791afeeb27545dce899631b4024714e..eddc54b8baaafda22a7eea30fab8124c727feaf6 100644 (file)
@@ -2975,7 +2975,7 @@ package body Sem_Type is
    -- New_Interps --
    -----------------
 
-   procedure New_Interps (N : Node_Id)  is
+   procedure New_Interps (N : Node_Id) is
       Map_Ptr : Int;
 
    begin
index 88973765a3abc11a74a809d8075f99247230639e..e57cd930e11e1d9337decff01e2cc49a31414de3 100644 (file)
@@ -6301,7 +6301,7 @@ package body Sem_Util is
                      end loop;
                   end if;
 
-                  if Present (Prev_Vis)  then
+                  if Present (Prev_Vis) then
 
                      --  Skip E in the visibility chain
 
@@ -12240,7 +12240,7 @@ package body Sem_Util is
                   else
                      Indx_Typ := Etype (Indx);
 
-                     if Is_Private_Type (Indx_Typ)  then
+                     if Is_Private_Type (Indx_Typ) then
                         Indx_Typ := Full_View (Indx_Typ);
                      end if;