From: Piotr Trojanek Date: Thu, 24 Dec 2020 09:20:13 +0000 (+0100) Subject: [Ada] Fix attributes Version and Body_Version for concurrent units X-Git-Tag: upstream/12.2.0~8334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e546292235587230fc9aa11b131f60cb123f42b;p=platform%2Fupstream%2Fgcc.git [Ada] Fix attributes Version and Body_Version for concurrent units gcc/ada/ * sem_attr.adb (Check_Program_Unit): Fix references to Concurrent_Kind and Is_Concurrent_Type; avoid repeated calls to Entity. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index a9d095d..98b0eca 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2298,16 +2298,15 @@ package body Sem_Attr is begin if Is_Entity_Name (P) then declare - K : constant Entity_Kind := Ekind (Entity (P)); - T : constant Entity_Id := Etype (Entity (P)); - + E : constant Entity_Id := Entity (P); begin - if K in Concurrent_Kind - | Entry_Kind - | Generic_Unit_Kind - | Subprogram_Kind - | E_Package - or else (K = E_Variable and then Is_Concurrent_Type (T)) + if Ekind (E) in E_Protected_Type + | E_Task_Type + | Entry_Kind + | Generic_Unit_Kind + | Subprogram_Kind + | E_Package + or else Is_Single_Concurrent_Object (E) then return; end if;