From a39bc02543ee30ac995104e369adc84a08798709 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 23 Jun 2020 10:18:48 +0200 Subject: [PATCH] [Ada] Simplify membership tests with N_Entity subtype gcc/ada/ * sem_ch12.adb: Replace list of N_Defining_... enumerations with N_Entity. --- gcc/ada/sem_ch12.adb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index cbf27e216ee..22e6371140a 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -8005,9 +8005,7 @@ package body Sem_Ch12 is end if; elsif No (Ent) - or else Nkind (Ent) not in N_Defining_Identifier - | N_Defining_Character_Literal - | N_Defining_Operator_Symbol + or else Nkind (Ent) not in N_Entity or else No (Scope (Ent)) or else (Scope (Ent) = Current_Instantiated_Parent.Gen_Id @@ -8174,9 +8172,7 @@ package body Sem_Ch12 is then Set_Entity (New_N, Entity (Name (Assoc))); - elsif Nkind (Assoc) in N_Defining_Identifier - | N_Defining_Character_Literal - | N_Defining_Operator_Symbol + elsif Nkind (Assoc) in N_Entity and then Expander_Active then -- Inlining case: we are copying a tree that contains @@ -15656,10 +15652,7 @@ package body Sem_Ch12 is -- preserve in this case, since the expansion will be redone in -- the instance. - if Nkind (E) not in N_Defining_Character_Literal - | N_Defining_Identifier - | N_Defining_Operator_Symbol - then + if Nkind (E) not in N_Entity then Set_Associated_Node (N, Empty); Set_Etype (N, Empty); return; -- 2.30.2