]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 19 Feb 2014 14:40:26 +0000 (15:40 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 19 Feb 2014 14:40:26 +0000 (15:40 +0100)
2014-02-19  Robert Dewar  <dewar@adacore.com>

* sem_ch3.adb, style.adb, sem_prag.adb, sem_ch13.adb: Minor reformatting
* a-sequio.adb: Remove useless pragma Extensions_Allowed (no
longer needed).

2014-02-19  Claire Dross  <dross@adacore.com>

* a-cfdlli.ads, a-cfhase.ads, a-cforma.ads, a-cfhama.ads,
a-cforse.ads, a-cofove.ads: Add Iterable aspect to formal containers.

From-SVN: r207900

12 files changed:
gcc/ada/ChangeLog
gcc/ada/a-cfdlli.ads
gcc/ada/a-cfhama.ads
gcc/ada/a-cfhase.ads
gcc/ada/a-cforma.ads
gcc/ada/a-cforse.ads
gcc/ada/a-cofove.ads
gcc/ada/a-sequio.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb
gcc/ada/style.adb

index 567aa0d9d3048a43428ab9f971845f975f1b5539..c25c5a5286462a74f5a10e5eec882b3ed56c5a48 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-19  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb, style.adb, sem_prag.adb, sem_ch13.adb: Minor reformatting
+       * a-sequio.adb: Remove useless pragma Extensions_Allowed (no
+       longer needed).
+
+2014-02-19  Claire Dross  <dross@adacore.com>
+
+       * a-cfdlli.ads, a-cfhase.ads, a-cforma.ads, a-cfhama.ads,
+       a-cforse.ads, a-cofove.ads: Add Iterable aspect to formal containers.
+
 2014-02-19  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_ch3.adb (Analyze_Declarations): Analyze
index 54f1886d297b235e9469c86dc89a724bece756e5..7b19f1dd2e31388b298643265218160299d398df 100644 (file)
@@ -63,7 +63,11 @@ package Ada.Containers.Formal_Doubly_Linked_Lists is
    pragma Annotate (GNATprove, External_Axiomatization);
    pragma Pure;
 
-   type List (Capacity : Count_Type) is private;
+   type List (Capacity : Count_Type) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
    pragma Preelaborable_Initialization (List);
 
    type Cursor is private;
index 71eed2b0e4db81cc23eae08973e4d08188f3cdea..16a950524228c7d8a4406bc6f0e9b275abb39873 100644 (file)
@@ -67,7 +67,11 @@ package Ada.Containers.Formal_Hashed_Maps is
    pragma Annotate (GNATprove, External_Axiomatization);
    pragma Pure;
 
-   type Map (Capacity : Count_Type; Modulus : Hash_Type) is private;
+   type Map (Capacity : Count_Type; Modulus : Hash_Type) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
    pragma Preelaborable_Initialization (Map);
 
    type Cursor is private;
index a3fc63dc03679a52893a50383ac53706f3915c03..fc02e04403d2fe6f4f88acb2424c27bfb688cba5 100644 (file)
@@ -69,7 +69,11 @@ package Ada.Containers.Formal_Hashed_Sets is
    pragma Annotate (GNATprove, External_Axiomatization);
    pragma Pure;
 
-   type Set (Capacity : Count_Type; Modulus : Hash_Type) is private;
+   type Set (Capacity : Count_Type; Modulus : Hash_Type) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
    pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
index a9426764560ac17bd5433282004eacb276add4bf..08dabf5541f7db5c2627bfe4ec5a3e1d6e9b662b 100644 (file)
@@ -70,7 +70,11 @@ package Ada.Containers.Formal_Ordered_Maps is
 
    function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
 
-   type Map (Capacity : Count_Type) is private;
+   type Map (Capacity : Count_Type) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
    pragma Preelaborable_Initialization (Map);
 
    type Cursor is private;
index e935be5e457bf2ee5b19a37f6dd1248ffb92ea68..bc69c1b1bf6ec63c45235c3816f7a9df7677ff4f 100644 (file)
@@ -68,7 +68,11 @@ package Ada.Containers.Formal_Ordered_Sets is
 
    function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
 
-   type Set (Capacity : Count_Type) is private;
+   type Set (Capacity : Count_Type) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
    pragma Preelaborable_Initialization (Set);
 
    type Cursor is private;
index 313165c49c662c24f568e13588406960fdc7c91e..17a3522d0263d691cb7b9688aaffa2712ba64f40 100644 (file)
@@ -75,7 +75,11 @@ package Ada.Containers.Formal_Vectors is
    subtype Capacity_Range is
      Count_Type range 0 .. Count_Type (Index_Type'Last - Index_Type'First + 1);
 
-   type Vector (Capacity : Capacity_Range) is private;
+   type Vector (Capacity : Capacity_Range) is private with
+     Iterable => (First       => First,
+                  Next        => Next,
+                  Has_Element => Has_Element,
+                  Element     => Element);
 
    type Cursor is private;
    pragma Preelaborable_Initialization (Cursor);
index b84252858bcc61f8d18cd99545d5e7cac241864d..31e5d757ea3ddb13d21f0cddd5c2cf7d08301b45 100644 (file)
@@ -202,15 +202,10 @@ package body Ada.Sequential_IO is
          --  buffer if Item is constrained, to check that the discriminants
          --  are correct.
 
-         pragma Extensions_Allowed (On);
-         --  Needed to allow Constrained reference here
-
-         if Element_Type'Has_Discriminants
-           and then Item'Constrained
-         then
+         if Element_Type'Has_Discriminants and then Item'Constrained then
             declare
                RsizS : constant SSE.Storage_Offset :=
-                 SSE.Storage_Offset (Rsiz - 1);
+                         SSE.Storage_Offset (Rsiz - 1);
 
                type SA is new SSE.Storage_Array (0 .. RsizS);
 
index 952e770ffb1495e8f64bf4c915ba6293160283f1..70cf819cbc213199c1041b792565f0b63c6ebd87 100644 (file)
@@ -130,7 +130,7 @@ package body Sem_Ch13 is
 
    function Get_Cursor_Type
      (Aspect : Node_Id;
-       Typ   : Entity_Id) return Entity_Id;
+      Typ    : Entity_Id) return Entity_Id;
    --  Find Cursor type in scope of Typ, by locating primitive operation First.
    --  For use in resolving the other primitive operations of an Iterable type.
 
@@ -9770,15 +9770,15 @@ package body Sem_Ch13 is
       Cursor   : Entity_Id;
 
    begin
-      --  If error already detected, return.
+      --  If error already detected, return
 
       if Error_Posted (Aspect) then
          return Any_Type;
       end if;
 
-      --  The cursor type for an Iterable aspect is the return type of
-      --  a non-overloaded First primitive operation. Locate association
-      --  for First.
+      --  The cursor type for an Iterable aspect is the return type of a
+      --  non-overloaded First primitive operation. Locate association for
+      --  First.
 
       Assoc := First (Component_Associations (Expression (Aspect)));
       First_Op  := Any_Id;
@@ -9798,7 +9798,7 @@ package body Sem_Ch13 is
 
       Cursor := Any_Type;
 
-      --  Locate function with desired name and profile in scope of type.
+      --  Locate function with desired name and profile in scope of type
 
       Func := First_Entity (Scope (Typ));
       while Present (Func) loop
@@ -9810,7 +9810,7 @@ package body Sem_Ch13 is
          then
             if Cursor /= Any_Type then
                Error_Msg_N
-                  ("Operation First for iterable type must be unique", Aspect);
+                 ("Operation First for iterable type must be unique", Aspect);
                return Any_Type;
 
             else
@@ -9825,7 +9825,7 @@ package body Sem_Ch13 is
 
       if Cursor = Any_Type then
          Error_Msg_N
-            ("No legal primitive operation First for Iterable type", Aspect);
+           ("No legal primitive operation First for Iterable type", Aspect);
       end if;
 
       return Cursor;
@@ -11524,7 +11524,7 @@ package body Sem_Ch13 is
       Element_Id     : Entity_Id;
 
    begin
-      --  If previous error aspect is unusable.
+      --  If previous error aspect is unusable
 
       if Cursor = Any_Type then
          return;
index 98991e2bbc7f5221d833ca576dd25a577c242b7e..664a1da7d458ec595f3cce8104d8e5c98b7a3fa4 100644 (file)
@@ -9398,7 +9398,7 @@ package body Sem_Ch3 is
                Error_Msg_Name_1 := Impl_Kind;
                Error_Msg_N
                 ("overriding operation& must have synchronization%",
-                   Subp_Alias);
+                 Subp_Alias);
             end if;
 
          --  If primitive has Optional synchronization, overriding operation
@@ -9410,7 +9410,7 @@ package body Sem_Ch3 is
                Error_Msg_Name_1 := Impl_Kind;
                Error_Msg_N
                 ("overriding operation& must have syncrhonization%",
-                   Subp_Alias);
+                 Subp_Alias);
          end if;
       end Check_Pragma_Implemented;
 
index b7d867462659252b0517af2649d5f41bb399c601..21514bfcbd026608e09f8dd2e34990536a4b7e21 100644 (file)
@@ -4651,8 +4651,7 @@ package body Sem_Prag is
                         Check_Grouping (Statements (HSS));
                      end if;
 
-                  --  The first pragma of the first topmost grouping has been
-                  --  found.
+                  --  First pragma of the first topmost grouping has been found
 
                   elsif Is_Loop_Pragma (Stmt) then
 
@@ -4755,6 +4754,7 @@ package body Sem_Prag is
 
          procedure Placement_Error (Constr : Node_Id) is
             LA : constant String := " with Loop_Entry";
+
          begin
             if Prag_Id = Pragma_Assert then
                Error_Msg_String (1 .. LA'Length) := LA;
index fffcf360cb4ffdc1f58f41e69ed2f6a246c27b53..d3f2d2c99ccecfa229bf565aa64bbea72ffde863 100644 (file)
@@ -260,8 +260,8 @@ package body Style is
 
    procedure Missing_Overriding (N : Node_Id; E : Entity_Id) is
       Nod : Node_Id;
-   begin
 
+   begin
       --  Perform the check on source subprograms and on subprogram instances,
       --  because these can be primitives of untagged types. Note that such
       --  indicators were introduced in Ada 2005.
@@ -278,7 +278,6 @@ package body Style is
            and then Is_Generic_Instance (E)
          then
             Nod := Next (Parent (Parent (List_Containing (N))));
-
          else
             Nod := N;
          end if;