]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
a-cdlili.adb, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Mon, 29 Aug 2011 13:42:00 +0000 (13:42 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Aug 2011 13:42:00 +0000 (15:42 +0200)
2011-08-29  Robert Dewar  <dewar@adacore.com>

* a-cdlili.adb, a-cdlili.ads, a-coinve.adb, a-coinve.ads,
sem_util.adb, sem_util.ads, a-cohama.adb, a-cohama.ads, a-coorse.adb,
a-coorse.ads, aspects.ads, sem_ch8.adb: Minor reformatting.

From-SVN: r178232

13 files changed:
gcc/ada/ChangeLog
gcc/ada/a-cdlili.adb
gcc/ada/a-cdlili.ads
gcc/ada/a-cohama.adb
gcc/ada/a-cohama.ads
gcc/ada/a-coinve.adb
gcc/ada/a-coinve.ads
gcc/ada/a-coorse.adb
gcc/ada/a-coorse.ads
gcc/ada/aspects.ads
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads

index f4e7ca36ca09e82c997f906bb6d884cc9064b909..1a078d5f2f4dbb3b10be58fe23ff3d090c913ebf 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-29  Robert Dewar  <dewar@adacore.com>
+
+       * a-cdlili.adb, a-cdlili.ads, a-coinve.adb, a-coinve.ads,
+       sem_util.adb, sem_util.ads, a-cohama.adb, a-cohama.ads, a-coorse.adb,
+       a-coorse.ads, aspects.ads, sem_ch8.adb: Minor reformatting.
+
 2011-08-29  Thomas Quinot  <quinot@adacore.com>
 
        * system-freebsd-x86_64.ads (Backend_Overflow_Checks): Set true True.
index 8a3b98358dd4b176c7401dafa49e579ce638abf4..4682ffbea500977cdad3def33602ee61827f43aa 100644 (file)
@@ -38,12 +38,16 @@ package body Ada.Containers.Doubly_Linked_Lists is
         Node      : Node_Access;
    end record;
 
-   overriding function First    (Object : Iterator) return Cursor;
-   overriding function Last     (Object : Iterator) return Cursor;
-   overriding function Next     (Object : Iterator; Position : Cursor)
-     return Cursor;
-   overriding function Previous (Object : Iterator; Position : Cursor)
-     return Cursor;
+   overriding function First (Object : Iterator) return Cursor;
+   overriding function Last  (Object : Iterator) return Cursor;
+
+   overriding function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
+
+   overriding function Previous
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
 
    -----------------------
    -- Local Subprograms --
@@ -918,6 +922,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
 
       declare
          Next_Node : constant Node_Access := Position.Node.Next;
+
       begin
          if Next_Node = null then
             return No_Element;
@@ -927,11 +932,13 @@ package body Ada.Containers.Doubly_Linked_Lists is
       end;
    end Next;
 
-   function Next (Object : Iterator; Position : Cursor) return Cursor is
+   function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor
+   is
    begin
       if Position.Node = Object.Container.Last then
          return No_Element;
-
       else
          return (Object.Container, Position.Node.Next);
       end if;
@@ -969,6 +976,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
 
       declare
          Prev_Node : constant Node_Access := Position.Node.Prev;
+
       begin
          if Prev_Node = null then
             return No_Element;
@@ -978,11 +986,13 @@ package body Ada.Containers.Doubly_Linked_Lists is
       end;
    end Previous;
 
-   function Previous (Object : Iterator; Position : Cursor) return Cursor is
+   function Previous
+     (Object   : Iterator;
+      Position : Cursor) return Cursor
+   is
    begin
       if Position.Node = Position.Container.First then
          return No_Element;
-
       else
          return (Object.Container, Position.Node.Prev);
       end if;
index 8b3a16abbf657132864d7a37ccabde38b908dd68..f7accff0a277cfa8e09af9c56f2615c31e61ff3b 100644 (file)
@@ -32,7 +32,8 @@
 ------------------------------------------------------------------------------
 
 private with Ada.Finalization;
-with Ada.Streams; use Ada.Streams;
+
+with Ada.Streams;              use Ada.Streams;
 with Ada.Iterator_Interfaces;
 
 generic
index fdf9696fd61762bf491e453935e3a7259f231bc9..c06ba9e35e462d1744c80f7880421508cfc729ab 100644 (file)
@@ -39,13 +39,15 @@ package body Ada.Containers.Hashed_Maps is
 
    type Iterator is new
      Map_Iterator_Interfaces.Forward_Iterator with record
-      Container : Map_Access;
-      Node      : Node_Access;
-   end record;
+        Container : Map_Access;
+        Node      : Node_Access;
+     end record;
 
    overriding function First (Object : Iterator) return Cursor;
-   overriding function Next  (Object : Iterator; Position : Cursor)
-     return Cursor;
+
+   overriding function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
 
    -----------------------
    -- Local Subprograms --
@@ -599,8 +601,8 @@ package body Ada.Containers.Hashed_Maps is
       B := B - 1;
    end Iterate;
 
-   function Iterate (Container : Map)
-      return Map_Iterator_Interfaces.Forward_Iterator'class
+   function Iterate
+     (Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'class
    is
       Node : constant Node_Access := HT_Ops.First (Container.HT);
       It   : constant Iterator := (Container'Unrestricted_Access, Node);
@@ -680,11 +682,13 @@ package body Ada.Containers.Hashed_Maps is
       Position := Next (Position);
    end Next;
 
-   function Next (Object : Iterator; Position : Cursor) return Cursor is
+   function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor
+   is
    begin
       if Position.Node = null then
          return No_Element;
-
       else
          return (Object.Container, Next (Position).Node);
       end if;
index 2ade56e19525c8fbf2ddff2b0498076084187d6d..d0bd3fdbbf2b65ece954c0b87eae20a05bc11672 100644 (file)
@@ -32,8 +32,9 @@
 ------------------------------------------------------------------------------
 
 private with Ada.Containers.Hash_Tables;
-with Ada.Streams; use Ada.Streams;
 private with Ada.Finalization;
+
+with Ada.Streams;             use Ada.Streams;
 with Ada.Iterator_Interfaces;
 
 generic
index fa90aaf31f5f9dc8077d1bf31d9de2900086b242..d66b9ec563b0f290bba51ca6eed1c0eac3916369 100644 (file)
@@ -46,11 +46,16 @@ package body Ada.Containers.Indefinite_Vectors is
    end record;
 
    overriding function First (Object : Iterator) return Cursor;
-   overriding function Last  (Object : Iterator) return Cursor;
-   overriding function Next  (Object : Iterator; Position : Cursor)
-     return Cursor;
-   overriding function Previous (Object : Iterator; Position : Cursor)
-     return Cursor;
+
+   overriding function Last (Object : Iterator) return Cursor;
+
+   overriding function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
+
+   overriding function Previous
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
 
    ---------
    -- "&" --
@@ -2433,7 +2438,9 @@ package body Ada.Containers.Indefinite_Vectors is
       return It;
    end Iterate;
 
-   function Iterate (Container : Vector; Start : Cursor)
+   function Iterate
+     (Container : Vector;
+      Start     : Cursor)
       return Vector_Iterator_Interfaces.Reversible_Iterator'class
    is
       It : constant Iterator :=
@@ -2584,10 +2591,6 @@ package body Ada.Containers.Indefinite_Vectors is
       end if;
    end Next;
 
-   ----------
-   -- Next --
-   ----------
-
    procedure Next (Position : in out Cursor) is
    begin
       if Position.Container = null then
index 866beb9c55f1f62a19288af811c40851da89cf0c..2380b4253097097d5d29dcfd9cfe98bda2802dd4 100644 (file)
@@ -32,7 +32,8 @@
 ------------------------------------------------------------------------------
 
 private with Ada.Finalization;
-with Ada.Streams; use Ada.Streams;
+
+with Ada.Streams;             use Ada.Streams;
 with Ada.Iterator_Interfaces;
 
 generic
@@ -344,7 +345,9 @@ package Ada.Containers.Indefinite_Vectors is
    function Iterate (Container : Vector)
       return Vector_Iterator_Interfaces.Reversible_Iterator'class;
 
-   function Iterate (Container : Vector; Start : Cursor)
+   function Iterate
+     (Container : Vector;
+      Start     : Cursor)
       return Vector_Iterator_Interfaces.Reversible_Iterator'class;
 
    procedure Reverse_Iterate
@@ -398,10 +401,10 @@ private
    end record;
 
    type Constant_Reference_Type
-      (Element : not null access constant Element_Type) is null record;
+     (Element : not null access constant Element_Type) is null record;
 
    type Reference_Type
-      (Element : not null access Element_Type) is null record;
+     (Element : not null access Element_Type) is null record;
 
    overriding procedure Adjust (Container : in out Vector);
 
index 2224fdf317e459c3629ca2cbc6a93662225871cb..b7d9d45dc03b97429ff73bd897033a298ad6b3d9 100644 (file)
@@ -42,16 +42,21 @@ package body Ada.Containers.Ordered_Sets is
 
    type Iterator is new
      Ordered_Set_Iterator_Interfaces.Reversible_Iterator with record
-      Container : access constant Set;
-      Node      : Node_Access;
-   end record;
+        Container : access constant Set;
+        Node      : Node_Access;
+     end record;
 
    overriding function First (Object : Iterator) return Cursor;
-   overriding function Last  (Object : Iterator) return Cursor;
-   overriding function Next  (Object : Iterator; Position : Cursor)
-     return Cursor;
-   overriding function Previous (Object : Iterator; Position : Cursor)
-     return Cursor;
+
+   overriding function Last (Object : Iterator) return Cursor;
+
+   overriding function Next
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
+
+   overriding function Previous
+     (Object   : Iterator;
+      Position : Cursor) return Cursor;
 
    ------------------------------
    -- Access to Fields of Node --
@@ -1248,9 +1253,7 @@ package body Ada.Containers.Ordered_Sets is
       Position := Next (Position);
    end Next;
 
-   function Next  (Object : Iterator; Position : Cursor)
-   return Cursor
-   is
+   function Next (Object : Iterator; Position : Cursor) return Cursor is
       pragma Unreferenced (Object);
    begin
       return Next (Position);
@@ -1305,13 +1308,12 @@ package body Ada.Containers.Ordered_Sets is
       Position := Previous (Position);
    end Previous;
 
-   overriding function Previous (Object : Iterator; Position : Cursor)
-   return Cursor
-   is
+   function Previous (Object : Iterator; Position : Cursor) return Cursor is
       pragma Unreferenced (Object);
    begin
       return Previous (Position);
    end Previous;
+
    -------------------
    -- Query_Element --
    -------------------
index cf52da66a1cd298496a9bd56bf7e403a0d3b915b..8dc0eda123ddc6adc6f737fb68e1e095115e5d9b 100644 (file)
@@ -33,7 +33,8 @@
 
 private with Ada.Containers.Red_Black_Trees;
 private with Ada.Finalization;
-with Ada.Streams; use Ada.Streams;
+
+with Ada.Streams;             use Ada.Streams;
 with Ada.Iterator_Interfaces;
 
 generic
@@ -254,10 +255,13 @@ package Ada.Containers.Ordered_Sets is
      (Container : Set;
       Process   : not null access procedure (Position : Cursor));
 
-   function Iterate (Container : Set)
+   function Iterate
+     (Container : Set)
       return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class;
 
-   function Iterate (Container : Set; Start : Cursor)
+   function Iterate
+     (Container : Set;
+      Start     : Cursor)
       return Ordered_Set_Iterator_Interfaces.Reversible_Iterator'class;
 
    generic
index b355cadc17d62744232b07e7bdffe791e7a36882..ecf74ba4d204a9e2f13a0568e3ea48132d562bca 100755 (executable)
@@ -360,7 +360,7 @@ package Aspects is
    --  empty list or No_List.
 
    function Find_Aspect (Ent : Entity_Id; A : Aspect_Id) return Node_Id;
-   --  Find value of a given aspect from aspect list of entity.
+   --  Find value of a given aspect from aspect list of entity
 
    procedure Move_Aspects (From : Node_Id; To : Node_Id);
    --  Moves aspects from 'From' node to 'To' node. Has_Aspects (To) must be
index 87d5717f41a810f754d96997e0ec35cc98222b71..47632f304c97f725c12344b4f55e1dc0a9c015d7 100644 (file)
@@ -5141,7 +5141,7 @@ package body Sem_Ch8 is
                            Next_Entity (Id);
                         end loop;
 
-                        --  If not found,  standard error message
+                        --  If not found, standard error message
 
                         Error_Msg_NE ("& not declared in&", N, Selector);
 
index f6088afc9d673de0640be1f82fd3087fea219684..adbe0ce820a7b0b2c81849a8cdad741abcea0967 100644 (file)
@@ -990,17 +990,14 @@ package body Sem_Util is
       Disc : Entity_Id)
    is
       Loc : constant Source_Ptr := Sloc (Expr);
-
    begin
       Set_Is_Overloaded (Expr, False);
       Rewrite (Expr,
         Make_Explicit_Dereference (Loc,
           Prefix =>
             Make_Selected_Component (Loc,
-              Prefix => Relocate_Node (Expr),
-              Selector_Name =>
-            New_Occurrence_Of (Disc, Loc))));
-
+              Prefix        => Relocate_Node (Expr),
+              Selector_Name => New_Occurrence_Of (Disc, Loc))));
       Set_Etype (Prefix (Expr), Etype (Disc));
       Set_Etype (Expr, Designated_Type (Etype (Disc)));
    end Build_Explicit_Dereference;
@@ -7178,9 +7175,7 @@ package body Sem_Util is
       Iface       : Entity_Id;
 
    begin
-      if not Is_Tagged_Type (Typ)
-        or else not Is_Derived_Type (Typ)
-      then
+      if not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then
          return False;
 
       else
@@ -7202,45 +7197,7 @@ package body Sem_Util is
 
          return False;
       end if;
-
    end Is_Iterator;
-
-   ----------------------------
-   -- Is_Reversible_Iterator --
-   ----------------------------
-
-   function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean is
-      Ifaces_List : Elist_Id;
-      Iface_Elmt  : Elmt_Id;
-      Iface       : Entity_Id;
-
-   begin
-      if not Is_Tagged_Type (Typ)
-        or else not Is_Derived_Type (Typ)
-      then
-         return False;
-      else
-
-         Collect_Interfaces (Typ, Ifaces_List);
-
-         Iface_Elmt := First_Elmt (Ifaces_List);
-         while Present (Iface_Elmt) loop
-            Iface := Node (Iface_Elmt);
-            if Chars (Iface) = Name_Reversible_Iterator
-              and then
-                Is_Predefined_File_Name
-                  (Unit_File_Name (Get_Source_Unit (Iface)))
-            then
-               return True;
-            end if;
-
-            Next_Elmt (Iface_Elmt);
-         end loop;
-
-      end if;
-      return False;
-   end Is_Reversible_Iterator;
-
    ------------
    -- Is_LHS --
    ------------
@@ -7466,15 +7423,15 @@ package body Sem_Util is
       --  original node is a conversion, then Is_Variable will not be true
       --  but we still want to allow the conversion if it converts a variable).
 
-      --  In Ada2012, the explicit dereference may be a rewritten call
-      --  to a Reference function.
-
       elsif Original_Node (AV) /= AV then
+
+         --  In Ada2012, the explicit dereference may be a rewritten call to a
+         --  Reference function.
+
          if Ada_Version >= Ada_2012
            and then Nkind (Original_Node (AV)) = N_Function_Call
            and then
-             Has_Implicit_Dereference
-               (Etype (Name (Original_Node (AV))))
+             Has_Implicit_Dereference (Etype (Name (Original_Node (AV))))
          then
             return True;
 
@@ -7884,6 +7841,40 @@ package body Sem_Util is
       return False;
    end Is_Renamed_Entry;
 
+   ----------------------------
+   -- Is_Reversible_Iterator --
+   ----------------------------
+
+   function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean is
+      Ifaces_List : Elist_Id;
+      Iface_Elmt  : Elmt_Id;
+      Iface       : Entity_Id;
+
+   begin
+      if not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then
+         return False;
+
+      else
+         Collect_Interfaces (Typ, Ifaces_List);
+
+         Iface_Elmt := First_Elmt (Ifaces_List);
+         while Present (Iface_Elmt) loop
+            Iface := Node (Iface_Elmt);
+            if Chars (Iface) = Name_Reversible_Iterator
+              and then
+                Is_Predefined_File_Name
+                  (Unit_File_Name (Get_Source_Unit (Iface)))
+            then
+               return True;
+            end if;
+
+            Next_Elmt (Iface_Elmt);
+         end loop;
+      end if;
+
+      return False;
+   end Is_Reversible_Iterator;
+
    ----------------------
    -- Is_Selector_Name --
    ----------------------
index 89ae19819aeb6762017f2e556ad3be4fa2b9a952..e9b4f4392c814809a4163da4f143ea0073f54fbb 100644 (file)
@@ -804,17 +804,15 @@ package Sem_Util is
    --  by a derived type declaration.
 
    function Is_Inherited_Operation_For_Type
-     (E : Entity_Id; Typ : Entity_Id) return Boolean;
+     (E   : Entity_Id;
+      Typ : Entity_Id) return Boolean;
    --  E is a subprogram. Return True is E is an implicit operation inherited
    --  by the derived type declaration for type Typ.
 
    function Is_Iterator (Typ : Entity_Id) return Boolean;
-   --  AI05-0139-2 : check whether Typ is derived from the predefined interface
+   --  AI05-0139-2: Check whether Typ is derived from the predefined interface
    --  Ada.Iterator_Interfaces.Forward_Iterator.
 
-   function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean;
-   --  Ditto for Ada.Iterator_Interfaces.Reversible_Iterator.
-
    function Is_LHS (N : Node_Id) return Boolean;
    --  Returns True iff N is used as Name in an assignment statement
 
@@ -882,6 +880,10 @@ package Sem_Util is
    function Is_Renamed_Entry (Proc_Nam : Entity_Id) return Boolean;
    --  Return True if Proc_Nam is a procedure renaming of an entry
 
+   function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean;
+   --  AI05-0139-2: Check whether Typ is derived from the predefined interface
+   --  Ada.Iterator_Interfaces.Reversible_Iterator.
+
    function Is_Selector_Name (N : Node_Id) return Boolean;
    --  Given an N_Identifier node N, determines if it is a Selector_Name.
    --  As described in Sinfo, Selector_Names are special because they