]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Record components do not appear in the Global contract
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 14 Nov 2018 11:40:35 +0000 (11:40 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:40:35 +0000 (11:40 +0000)
In the Global contract there can be only entire objects, which are
represented either as N_Identifier or N_Expanded_Name. The test for
record components was dead. Now removed. Semantics unaffected.

2018-11-14  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_util.adb (First_From_Global_List): Do not expect
N_Selected_Component in the Global contract; simplify assertion
with Nam_In.

From-SVN: r266113

gcc/ada/ChangeLog
gcc/ada/sem_util.adb

index 04caf7a5a5eb6bbe96ce4b3cea74488c41847661..b1531d1c9282218e5cba653f0130287005da7544 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
+
+       * sem_util.adb (First_From_Global_List): Do not expect
+       N_Selected_Component in the Global contract; simplify assertion
+       with Nam_In.
+
 2018-11-14  Piotr Trojanek  <trojanek@adacore.com>
 
        * sem_ch12.adb (Instantiate_Object): Set
index f4b6579b34c9348d5a13aab8cf5ff098e8378633..430c0c66b6a5fe6fea46e3fece2df65ff89d89ea 100644 (file)
@@ -8594,8 +8594,7 @@ package body Sem_Util is
          --  Single global item declaration (only input items)
 
          elsif Nkind_In (List, N_Expanded_Name,
-                               N_Identifier,
-                               N_Selected_Component)
+                               N_Identifier)
          then
             if Global_Mode = Name_Input then
                return List;
@@ -8648,10 +8647,10 @@ package body Sem_Util is
       Body_Id : Entity_Id;
 
    begin
-      pragma Assert (Global_Mode = Name_Input
-                      or else Global_Mode = Name_Output
-                      or else Global_Mode = Name_In_Out
-                      or else Global_Mode = Name_Proof_In);
+      pragma Assert (Nam_In (Global_Mode, Name_Input,
+                                          Name_Output,
+                                          Name_In_Out,
+                                          Name_Proof_In));
 
       --  Retrieve the suitable pragma Global or Refined_Global. In the second
       --  case, it can only be located on the body entity.