aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo-utils.adb
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2021-08-26 13:40:14 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-04 08:45:04 +0000
commitcf1c69fb8c6b4ce894b95250028ed1ae5982c739 (patch)
tree540597a02b161989021236496bf1eea281530d7f /gcc/ada/einfo-utils.adb
parent2376b04d474656af0234bee68af144a7780253b6 (diff)
downloadgcc-cf1c69fb8c6b4ce894b95250028ed1ae5982c739.zip
gcc-cf1c69fb8c6b4ce894b95250028ed1ae5982c739.tar.gz
gcc-cf1c69fb8c6b4ce894b95250028ed1ae5982c739.tar.bz2
[Ada] Entities in E_Loop scopes are not library-level entities
gcc/ada/ * sem_util.adb (Is_Library_Level_Entity): Return False for entities defined in E_Loop scopes. This change is not required by the frontend; it is required by tools that depend on the frontend sources. * einfo-utils.adb (Is_Dynamic_Scope): Code cleanup.
Diffstat (limited to 'gcc/ada/einfo-utils.adb')
-rw-r--r--gcc/ada/einfo-utils.adb31
1 files changed, 12 insertions, 19 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index c6c3277..38cfe34 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -1425,26 +1425,19 @@ package body Einfo.Utils is
function Is_Dynamic_Scope (Id : E) return B is
begin
- return
- Ekind (Id) = E_Block
- or else
- Ekind (Id) = E_Function
- or else
- Ekind (Id) = E_Procedure
- or else
- Ekind (Id) = E_Subprogram_Body
- or else
- Ekind (Id) = E_Task_Type
- or else
- (Ekind (Id) = E_Limited_Private_Type
- and then Present (Full_View (Id))
- and then Ekind (Full_View (Id)) = E_Task_Type)
- or else
- Ekind (Id) = E_Entry
- or else
- Ekind (Id) = E_Entry_Family
+ return Ekind (Id) in E_Block
+ -- Including an E_Block that came from an N_Expression_With_Actions
+ | E_Entry
+ | E_Entry_Family
+ | E_Function
+ | E_Procedure
+ | E_Return_Statement
+ | E_Subprogram_Body
+ | E_Task_Type
or else
- Ekind (Id) = E_Return_Statement;
+ (Ekind (Id) = E_Limited_Private_Type
+ and then Present (Full_View (Id))
+ and then Ekind (Full_View (Id)) = E_Task_Type);
end Is_Dynamic_Scope;
--------------------