aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2019-08-21 08:29:37 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-21 08:29:37 +0000
commit5188952e59475e3744c88aba9d9e8b07c8364987 (patch)
tree0bd9337fe385e902846c2fe02e621a9b1e628790 /gcc
parent93a08e1e4a6218aaccac5538cf0b263ddae78ff8 (diff)
downloadgcc-5188952e59475e3744c88aba9d9e8b07c8364987.zip
gcc-5188952e59475e3744c88aba9d9e8b07c8364987.tar.gz
gcc-5188952e59475e3744c88aba9d9e8b07c8364987.tar.bz2
[Ada] Replace low-level membership tests with high-level routines
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. From-SVN: r274777
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/exp_util.adb2
-rw-r--r--gcc/ada/sem_ch8.adb2
-rw-r--r--gcc/ada/sem_ch9.adb3
4 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 08989eb..fc1eb94 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 78019ab..d3f648f 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -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
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 38c3980..a7918da 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -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
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index 0696f92..bc8ab36 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -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;