[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 20 Oct 2015 10:56:25 +0000 (12:56 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 20 Oct 2015 10:56:25 +0000 (12:56 +0200)
2015-10-20  Bob Duff  <duff@adacore.com>

* a-cbdlli.ads, a-cbhase.ads, a-cbmutr.ads, a-cborse.ads,
* a-cdlili.ads, a-cidlli.ads, a-cihase.ads, a-cimutr.ads,
* a-ciorse.ads, a-cobove.ads, a-cohase.ads, a-coinve.ads,
* a-comutr.ads, a-convec.ads, a-coorse.ads: Use non-private with clause.

2015-10-20  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_util.adb (Requires_Cleanup_Actions): A loop parameter does not
require finalization actions.

2015-10-20  Ed Schonberg  <schonberg@adacore.com>

* par-ch3.adb (P_Declarative_Items): In case of misplaced
aspect specifications, ensure that flag Done is properly set to
continue parse.

2015-10-20  Hristian Kirtchev  <kirtchev@adacore.com>

* rtsfind.ads Remove the entries for Ada.Synchronous_Task_Control
and Suspension_Object from tables RE_Id, RE_Unit_Table and RTU_Id.
* sem_util.adb (Is_Descendant_Of_Suspension_Object): Update
the comment on usage. Use routine Is_Suspension_Object to detect
whether a type matches Suspension_Object.
(Is_Suspension_Object): New routine.
* snames.ads-tmpl: Add predefined names for Suspension_Object
and Synchronous_Task_Control.

From-SVN: r229049

21 files changed:
gcc/ada/ChangeLog
gcc/ada/a-cbdlli.ads
gcc/ada/a-cbhase.ads
gcc/ada/a-cbmutr.ads
gcc/ada/a-cborse.ads
gcc/ada/a-cdlili.ads
gcc/ada/a-cidlli.ads
gcc/ada/a-cihase.ads
gcc/ada/a-cimutr.ads
gcc/ada/a-ciorse.ads
gcc/ada/a-cobove.ads
gcc/ada/a-cohase.ads
gcc/ada/a-coinve.ads
gcc/ada/a-comutr.ads
gcc/ada/a-convec.ads
gcc/ada/a-coorse.ads
gcc/ada/exp_util.adb
gcc/ada/par-ch3.adb
gcc/ada/rtsfind.ads
gcc/ada/sem_util.adb
gcc/ada/snames.ads-tmpl

index 5e189a1c907bd88bc40636580d34c09a9a32e146..63ad65539b6d8f4e43625b57bbe4b2e0726d8643 100644 (file)
@@ -1,3 +1,32 @@
+2015-10-20  Bob Duff  <duff@adacore.com>
+
+       * a-cbdlli.ads, a-cbhase.ads, a-cbmutr.ads, a-cborse.ads,
+       * a-cdlili.ads, a-cidlli.ads, a-cihase.ads, a-cimutr.ads,
+       * a-ciorse.ads, a-cobove.ads, a-cohase.ads, a-coinve.ads,
+       * a-comutr.ads, a-convec.ads, a-coorse.ads: Use non-private with clause.
+
+2015-10-20  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * exp_util.adb (Requires_Cleanup_Actions): A loop parameter does not
+       require finalization actions.
+
+2015-10-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * par-ch3.adb (P_Declarative_Items): In case of misplaced
+       aspect specifications, ensure that flag Done is properly set to
+       continue parse.
+
+2015-10-20  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * rtsfind.ads Remove the entries for Ada.Synchronous_Task_Control
+       and Suspension_Object from tables RE_Id, RE_Unit_Table and RTU_Id.
+       * sem_util.adb (Is_Descendant_Of_Suspension_Object): Update
+       the comment on usage. Use routine Is_Suspension_Object to detect
+       whether a type matches Suspension_Object.
+       (Is_Suspension_Object): New routine.
+       * snames.ads-tmpl: Add predefined names for Suspension_Object
+       and Synchronous_Task_Control.
+
 2015-10-20  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_smem.adb (Check_Shared_Var): Clean up code that handles
index ba063c1139e337d59fccaaa4a72326913070c7fd..f09c3ed0dd80d68cd404888dd33f821de75d931d 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Streams;
 private with Ada.Finalization;
 
index 7f55d8d26e1306e910d98c3890394c7a756dcdd5..87e35cab3f3faf66f943b0dd3cee2072bc306bf6 100644 (file)
@@ -34,7 +34,7 @@
 with Ada.Iterator_Interfaces;
 
 private with Ada.Containers.Hash_Tables;
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Streams;
 private with Ada.Finalization; use Ada.Finalization;
 
index 93b5e27d89e44aef34f420344d49914401bd5a57..fd8c20662a0b69b3b4fc7ec85b3ee3997c3365e5 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Streams;
 
 generic
index a12a7988a93a20a08b4e24fda353f897bea2faac..7d76f7844d82ca0d96f13038b0887e70e58ee21f 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Containers.Red_Black_Trees;
 private with Ada.Streams;
 private with Ada.Finalization;
index 45abeb1559f3f44a69f1076512b0f517191bde5e..abc6de7734ec550ed6ea3d25e03b6f852fe3a590 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index 46354afa19e141758b681810dc0fe1a510f3fe41..5b181105f495138825cd406955580ab34a9912d4 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index db4d8bda9dc7831bcc1a3604b1271db109b7443c..d908d7fd72c2754effe9692de2582b24f1569817 100644 (file)
@@ -34,7 +34,7 @@
 with Ada.Iterator_Interfaces;
 
 private with Ada.Containers.Hash_Tables;
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Streams;
 private with Ada.Finalization;
 
index dd636511ea4717a3112478166b5e80e7949e528e..ad7e34c0e02107617cd1a09cb88c5577a1d93598 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index e0e95ede1b363009bc28a029144c69e7667b9d19..15589b86827a9aa06679088da33eeb3eca5db509 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Containers.Red_Black_Trees;
 private with Ada.Finalization;
 private with Ada.Streams;
index 1fb346c79723fd8b47b67df5bea943b39b1eaf94..869f2bbb646711bcfbe7b8cc16711d4d9517fd15 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Streams;
 private with Ada.Finalization;
 
index 91f134539435713d196ebce69fe7da771c3a78d5..97cd5f123237578e9b09aabc4d98aaec7ca8e004 100644 (file)
@@ -34,7 +34,7 @@
 with Ada.Iterator_Interfaces;
 
 private with Ada.Containers.Hash_Tables;
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index 5cb97d53ddbbf6a07b1aa64ab02744fa541f3295..1a0ce992764a2c9d7ed55bfdefa80fc506e20cb3 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index 918edfdd8aa52ee6c6905b75a21442a9d4f7b41a..25fadf1f3a76f654d4e77614a7d9017fee68dc05 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index bf5232908878dde630b58f075bfd21004644f116..413403d72cd32ca546f02b46fd2fa45e5a254854 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Finalization;
 private with Ada.Streams;
 
index d2e882a7f8241e39b3e732c993b2fc57be52d903..d127a52b283ea57dd0d1ef0fe14aa3ab5ecd4d0f 100644 (file)
@@ -33,7 +33,7 @@
 
 with Ada.Iterator_Interfaces;
 
-private with Ada.Containers.Helpers;
+with Ada.Containers.Helpers;
 private with Ada.Containers.Red_Black_Trees;
 private with Ada.Finalization;
 private with Ada.Streams;
index 2ff6d5c83f61daf395f3423a7620c23f54134ecc..fa8d17f4f0df97091d11de7ec37389540698e7e3 100644 (file)
@@ -8022,6 +8022,16 @@ package body Exp_Util is
             elsif Is_Ignored_Ghost_Entity (Obj_Id) then
                null;
 
+            --  The expansion of iterator loops generates an object declaration
+            --  where the Ekind is explicitly set to loop parameter. This is to
+            --  ensure that the loop parameter behaves as a constant from user
+            --  code point of view. Such object are never controlled and do not
+            --  require cleanup actions. An iterator loop over a container of
+            --  controlled objects does not produce such object declarations.
+
+            elsif Ekind (Obj_Id) = E_Loop_Parameter then
+               return False;
+
             --  The object is of the form:
             --    Obj : Typ [:= Expr];
             --
index 0be121775134b5d475fda30b36601327a82215e2..86b2a6d295ca38bfba52ec2091d4cc03f2ad60f5 100644 (file)
@@ -4425,6 +4425,12 @@ package body Ch3 is
 
                else
                   Error_Msg_SC ("aspect specifications not allowed here");
+
+                  --  Assume that this is a misplaced aspect specification
+                  --  within a declarative list. After discarding the
+                  --  misplaced aspects we can continue the scan.
+
+                  Done := False;
                end if;
 
                declare
index 22f93901e0cf484a2c7bfb4e24e7410365b635e4..d320639f65570e21f13c1a099fbb3d8caaed6ae3 100644 (file)
@@ -131,7 +131,6 @@ package Rtsfind is
       Ada_Real_Time,
       Ada_Streams,
       Ada_Strings,
-      Ada_Synchronous_Task_Control,
       Ada_Tags,
       Ada_Task_Identification,
       Ada_Task_Termination,
@@ -607,8 +606,6 @@ package Rtsfind is
 
      RE_Unbounded_String,                -- Ada.Strings.Unbounded
 
-     RE_Suspension_Object,               -- Ada.Synchronous_Task_Control
-
      RE_Access_Level,                    -- Ada.Tags
      RE_Alignment,                       -- Ada.Tags
      RE_Address_Array,                   -- Ada.Tags
@@ -1840,8 +1837,6 @@ package Rtsfind is
 
      RE_Unbounded_String                 => Ada_Strings_Unbounded,
 
-     RE_Suspension_Object                => Ada_Synchronous_Task_Control,
-
      RE_Access_Level                     => Ada_Tags,
      RE_Alignment                        => Ada_Tags,
      RE_Address_Array                    => Ada_Tags,
index 27b8f9e5e74d72d3dd5518c8a8946ca9deaffd03..6875f3aeb964e740084d0158d19357359ae21af3 100644 (file)
@@ -11397,9 +11397,7 @@ package body Sem_Util is
       function Is_Descendant_Of_Suspension_Object
         (Typ : Entity_Id) return Boolean;
       --  Determine whether type Typ is a descendant of type Suspension_Object
-      --  defined in Ada.Synchronous_Task_Control. This routine is similar to
-      --  Sem_Util.Is_Descendent_Of, however this version does not load unit
-      --  Ada.Synchronous_Task_Control.
+      --  defined in Ada.Synchronous_Task_Control.
 
       ----------------------------------------
       -- Is_Descendant_Of_Suspension_Object --
@@ -11408,24 +11406,39 @@ package body Sem_Util is
       function Is_Descendant_Of_Suspension_Object
         (Typ : Entity_Id) return Boolean
       is
-         Cur_Typ : Entity_Id;
-         Par_Typ : Entity_Id;
+         function Is_Suspension_Object (Id : Entity_Id) return Boolean;
+         --  Determine whether arbitrary entity Id denotes Suspension_Object
+         --  defined in Ada.Synchronous_Task_Control.
 
-      begin
-         --  Do not attempt to load Ada.Synchronous_Task_Control in No_Run_Time
-         --  mode. The unit contains tagged types and those are not allowed in
-         --  this mode.
+         --------------------------
+         -- Is_Suspension_Object --
+         --------------------------
 
-         if No_Run_Time_Mode then
-            return False;
+         function Is_Suspension_Object (Id : Entity_Id) return Boolean is
+         begin
+            --  This approach does an exact name match rather than to rely on
+            --  RTSfind. Routine Is_Effectively_Volatile is used by clients of
+            --  the front end at point where all auxiliary tables are locked
+            --  and any modifications to them are treated as violations. Do not
+            --  tamper with the tables, instead examine the Chars fields of all
+            --  the scopes of Id.
 
-         --  Unit Ada.Synchronous_Task_Control is not available, the type
-         --  cannot possibly be a descendant of Suspension_Object.
+            return
+              Chars (Id) = Name_Suspension_Object
+                and then Present (Scope (Id))
+                and then Chars (Scope (Id)) = Name_Synchronous_Task_Control
+                and then Present (Scope (Scope (Id)))
+                and then Chars (Scope (Scope (Id))) = Name_Ada;
+         end Is_Suspension_Object;
 
-         elsif not RTE_Available (RE_Suspension_Object) then
-            return False;
-         end if;
+         --  Local variables
 
+         Cur_Typ : Entity_Id;
+         Par_Typ : Entity_Id;
+
+      --  Start of processing for Is_Descendant_Of_Suspension_Object
+
+      begin
          --  Climb the type derivation chain checking each parent type against
          --  Suspension_Object.
 
@@ -11435,7 +11448,7 @@ package body Sem_Util is
 
             --  The current type is a match
 
-            if Is_RTE (Cur_Typ, RE_Suspension_Object) then
+            if Is_Suspension_Object (Cur_Typ) then
                return True;
 
             --  Stop the traversal once the root of the derivation chain has
index d5b06a8677b3da6b27aa6bd37ff13a005eef7ffb..7f252875cefad6b33f91ff2eca5d07f28bc388b7 100644 (file)
@@ -1398,6 +1398,8 @@ package Snames is
    --  Other miscellaneous names used in front end
 
    Name_Unaligned_Valid                  : constant Name_Id := N + $;
+   Name_Suspension_Object                : constant Name_Id := N + $;
+   Name_Synchronous_Task_Control         : constant Name_Id := N + $;
 
    --  Names used to implement iterators over predefined containers