]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Replace low-level membership tests with high-level routines
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:29:37 +0000 (08:29 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:29:37 +0000 (08:29 +0000)
Code cleanup to improve readablity. Semantics unaffected.

2019-08-21  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_util.adb (Corresponding_Runtime_Package): Use high-level
Is_Protected_Type.
* sem_ch8.adb (Analyze_Renamed_Entry): Likewise.
* sem_ch9.adb (Analyze_Requeue): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274777 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_util.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_ch9.adb

index 08989eb8f4e917904da16c0004ac04d02265f4df..fc1eb946533ef0888602f167a201bdac4ac35579 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-21  Piotr Trojanek  <trojanek@adacore.com>
+
+       * exp_util.adb (Corresponding_Runtime_Package): Use high-level
+       Is_Protected_Type.
+       * sem_ch8.adb (Analyze_Renamed_Entry): Likewise.
+       * sem_ch9.adb (Analyze_Requeue): Likewise.
+
 2019-08-21  Javier Miranda  <miranda@adacore.com>
 
        * sem_util.adb (Update_Named_Associations): Update
index 78019ab3c32389a8ea42a8d415434c65225359cb..d3f648f3dcd46c649bf07462d0f1c15cdffd76a4 100644 (file)
@@ -4609,7 +4609,7 @@ package body Exp_Util is
    begin
       pragma Assert (Is_Concurrent_Type (Typ));
 
-      if Ekind (Typ) in Protected_Kind then
+      if Is_Protected_Type (Typ) then
          if Has_Entries (Typ)
 
             --  A protected type without entries that covers an interface and
index 38c3980278da9eb204e2008873e1f50e2c434615..a7918dacbcf5ede80f994a9d2758519246c16d67 100644 (file)
@@ -1696,7 +1696,7 @@ package body Sem_Ch8 is
       --  AI05-0225: If the renamed entity is a procedure or entry of a
       --  protected object, the target object must be a variable.
 
-      if Ekind (Scope (Old_S)) in Protected_Kind
+      if Is_Protected_Type (Scope (Old_S))
         and then Ekind (New_S) = E_Procedure
         and then not Is_Variable (Prefix (Nam))
       then
index 0696f928e3855a3f75d95eb27c4d3212dd4b976e..bc8ab36d4d006eaff9a2af64b7abcfafc474873a 100644 (file)
@@ -2350,8 +2350,7 @@ package body Sem_Ch9 is
          for S in reverse 0 .. Scope_Stack.Last loop
             Req_Scope := Scope_Stack.Table (S).Entity;
 
-            exit when Ekind (Req_Scope) in Task_Kind
-              or else Ekind (Req_Scope) in Protected_Kind;
+            exit when Is_Concurrent_Type (Req_Scope);
 
             if Is_Entry (Req_Scope) then
                Outer_Ent := Req_Scope;