[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 31 Aug 2011 09:27:37 +0000 (11:27 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 31 Aug 2011 09:27:37 +0000 (11:27 +0200)
2011-08-31  Matthew Heaney  <heaney@adacore.com>

* a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock
status.

2011-08-31  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb: Set kind of loop parameter properly, to preserve all
errors in B tests.

2011-08-31  Jose Ruiz  <ruiz@adacore.com>

* sem_ch13.adb (Analyze_Aspect_Specifications): For the Priority and
Interrupt_Priority aspects, force the analysis of the aspect expression
(when building the equivalent pragma). Otherwise, its analysis is done
too late, after the task or protected object has been created.
* sem_ch9.adb (Analyze_Single_Protected_Declaration,
Analyze_Single_Task_Declaration): Remove the code to move the aspects
to the object declaration because they are needed in the type
declaration.

From-SVN: r178370

gcc/ada/ChangeLog
gcc/ada/a-rbtgbo.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_ch9.adb

index 3240bcdfda5284ce3e817a8216ef8e7f8871a4cc..6ced91054a747afaedb402e58c3186debaf45471 100644 (file)
@@ -1,3 +1,24 @@
+2011-08-31  Matthew Heaney  <heaney@adacore.com>
+
+       * a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock
+       status.
+
+2011-08-31  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb: Set kind of loop parameter properly, to preserve all
+       errors in B tests.
+
+2011-08-31  Jose Ruiz  <ruiz@adacore.com>
+
+       * sem_ch13.adb (Analyze_Aspect_Specifications): For the Priority and
+       Interrupt_Priority aspects, force the analysis of the aspect expression
+       (when building the equivalent pragma). Otherwise, its analysis is done
+       too late, after the task or protected object has been created.
+       * sem_ch9.adb (Analyze_Single_Protected_Declaration,
+       Analyze_Single_Task_Declaration): Remove the code to move the aspects
+       to the object declaration because they are needed in the type
+       declaration.
+
 2011-08-31  Robert Dewar  <dewar@adacore.com>
 
        * exp_ch5.adb, exp_ch7.ads, sem_ch5.adb, put_scos.adb, s-rannum.adb,
index f420438efac6808eaef5286b6ce898d2f419154e..a2590e93390c5e0614c5060564622853601f1948 100644 (file)
@@ -59,15 +59,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
            "attempt to tamper with cursors (container is busy)";
       end if;
 
+      --  The lock status (which monitors "element tampering") always implies
+      --  that the busy status (which monitors "cursor tampering") is set too;
+      --  this is a representation invariant. Thus if the busy bit is not set,
+      --  then the lock bit must not be set either.
+      pragma Assert (Tree.Lock = 0);
+
       Tree.First  := 0;
       Tree.Last   := 0;
       Tree.Root   := 0;
       Tree.Length := 0;
-
-      --  Why are the following commented out with no explanation ???
-      --  Tree.Busy
-      --  Tree.Lock
-
       Tree.Free   := -1;
    end Clear_Tree;
 
index 787d564ed6eca95794ef4289d2ad471f9c217f8f..a4b1024e3c92f9108d402c629e869cb21e296b7a 100644 (file)
@@ -1164,7 +1164,9 @@ package body Sem_Ch13 is
                       Pragma_Identifier            =>
                         Make_Identifier (Sloc (Id), Pname),
                       Pragma_Argument_Associations =>
-                        New_List (Relocate_Node (Expr)));
+                        New_List
+                          (Make_Pragma_Argument_Association
+                            (Sloc (Id), Expression => Relocate_Node (Expr))));
 
                   Set_From_Aspect_Specification (Aitem, True);
 
@@ -1526,6 +1528,12 @@ package body Sem_Ch13 is
                            end if;
 
                            Prepend (Aitem, To => L);
+
+                           --  Analyze rewritten pragma. Otherwise, its
+                           --  analysis is done too late, after the task or
+                           --  protected object has been created.
+
+                           Analyze (Aitem);
                         end;
 
                      --  For all other cases, insert in sequence
index f8f00395c48bf09f8574c0a945b485824a2de10f..50c9bb68f976eba87b775c6ff3759cfb514dbf6d 100644 (file)
@@ -1965,7 +1965,6 @@ package body Sem_Ch5 is
 
             begin
                Enter_Name (Id);
-               Set_Ekind (Id, E_Constant);
 
                --  We always consider the loop variable to be referenced, since
                --  the loop may be used just for counting purposes.
@@ -2058,6 +2057,11 @@ package body Sem_Ch5 is
                            Analyze (DS);
                         end if;
 
+                        --  Set kind of loop parameter, which may be used in
+                        --  the subsequent analysis of of the condition in a
+                        --  quantified expression.
+
+                        Set_Ekind (Id, E_Loop_Parameter);
                         return;
                      end;
 
index 86a8fe6f48313093c026626b749fd3e99dd22158..cdac2f787d3199db948acffb13a1a4fa800e51c7 100644 (file)
@@ -23,7 +23,6 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Aspects;  use Aspects;
 with Atree;    use Atree;
 with Checks;   use Checks;
 with Einfo;    use Einfo;
@@ -1726,7 +1725,6 @@ package body Sem_Ch9 is
           Defining_Identifier => O_Name,
           Object_Definition   => Make_Identifier (Loc,  Chars (T)));
 
-      Move_Aspects (N, O_Decl);
       Rewrite (N, T_Decl);
       Insert_After (N, O_Decl);
       Mark_Rewrite_Insertion (O_Decl);
@@ -1796,7 +1794,6 @@ package body Sem_Ch9 is
           Defining_Identifier => O_Name,
           Object_Definition   => Make_Identifier (Loc, Chars (T)));
 
-      Move_Aspects (N, O_Decl);
       Rewrite (N, T_Decl);
       Insert_After (N, O_Decl);
       Mark_Rewrite_Insertion (O_Decl);