diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-10-26 12:15:34 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-26 03:39:48 -0500 |
commit | a160b4e046d11b51cbedb936b13d15e3d0b19f7e (patch) | |
tree | 7d57e0f485e4ef5287dd7156f3126af10ce60abe | |
parent | 416f9a2726513adc796ca7ed2145fca54da9fd1d (diff) | |
download | gcc-a160b4e046d11b51cbedb936b13d15e3d0b19f7e.zip gcc-a160b4e046d11b51cbedb936b13d15e3d0b19f7e.tar.gz gcc-a160b4e046d11b51cbedb936b13d15e3d0b19f7e.tar.bz2 |
[Ada] Reuse Is_Concurrent_Type when detecting protected or task types
gcc/ada/
* exp_ch13.adb, exp_ch9.adb, sem_ch8.adb, sem_util.adb: Replace
a combination of Is_Protected_Type and Is_Task_Type by
Is_Concurrent_Type.
-rw-r--r-- | gcc/ada/exp_ch13.adb | 5 | ||||
-rw-r--r-- | gcc/ada/exp_ch9.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index 30f101d..89efca9 100644 --- a/gcc/ada/exp_ch13.adb +++ b/gcc/ada/exp_ch13.adb @@ -582,9 +582,8 @@ package body Exp_Ch13 is Install_Visible_Declarations (E_Scope); end if; - if Is_Package_Or_Generic_Package (E_Scope) or else - Is_Protected_Type (E_Scope) or else - Is_Task_Type (E_Scope) + if Is_Concurrent_Type (E_Scope) + or else Is_Package_Or_Generic_Package (E_Scope) then Install_Private_Declarations (E_Scope); end if; diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 7207723..7b70321 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -10579,13 +10579,12 @@ package body Exp_Ch9 is Extract_Entry (N, Concval, Ename, Index); Conc_Typ := Etype (Concval); - -- Examine the scope stack in order to find nearest enclosing protected - -- or task type. This will constitute our invocation source. + -- Examine the scope stack in order to find nearest enclosing concurrent + -- type. This will constitute our invocation source. Old_Typ := Current_Scope; while Present (Old_Typ) - and then not Is_Protected_Type (Old_Typ) - and then not Is_Task_Type (Old_Typ) + and then not Is_Concurrent_Type (Old_Typ) loop Old_Typ := Scope (Old_Typ); end loop; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 9404d68..950d4a0 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -7519,7 +7519,7 @@ package body Sem_Ch8 is -- Reference to type name in predicate/invariant expression - elsif (Is_Task_Type (P_Type) or else Is_Protected_Type (P_Type)) + elsif Is_Concurrent_Type (P_Type) and then not In_Open_Scopes (P_Name) and then (not Is_Concurrent_Type (Etype (P_Name)) or else not In_Open_Scopes (Etype (P_Name))) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6875e47..a5db24d 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -25472,7 +25472,7 @@ package body Sem_Util is -- All other cases do not require a transient scope else - pragma Assert (Is_Protected_Type (Typ) or else Is_Task_Type (Typ)); + pragma Assert (Is_Concurrent_Type (Typ)); return False; end if; end Old_Requires_Transient_Scope; |