From: Piotr Trojanek Date: Tue, 24 Nov 2020 21:56:40 +0000 (+0100) Subject: [Ada] Simplify discarding nodes when processing aspect/pragma Priority X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=958eed88b933a7275c83ff11f7140c3f7ae7aeac;p=gcc.git [Ada] Simplify discarding nodes when processing aspect/pragma Priority gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specifications): Simplify code for aspect Priority. * sem_prag.adb (Analyze_Pragma): Simplify code for pragma Priority. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index b48aeb47739..1327d31c0c9 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3408,15 +3408,11 @@ package body Sem_Ch13 is -- System.Tasking, but this package does not trigger the -- required initialization of the run-time library. - declare - Discard : Entity_Id; - begin - if Restricted_Profile then - Discard := RTE (RE_Activate_Restricted_Tasks); - else - Discard := RTE (RE_Activate_Tasks); - end if; - end; + if Restricted_Profile then + Discard_Node (RTE (RE_Activate_Restricted_Tasks)); + else + Discard_Node (RTE (RE_Activate_Tasks)); + end if; -- Handling for these aspects in subprograms is complete diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 1ffe513e9a4..b093808113a 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -21364,16 +21364,11 @@ package body Sem_Prag is -- package does not trigger the required initialization of the -- run-time library. - declare - Discard : Entity_Id; - pragma Warnings (Off, Discard); - begin - if Restricted_Profile then - Discard := RTE (RE_Activate_Restricted_Tasks); - else - Discard := RTE (RE_Activate_Tasks); - end if; - end; + if Restricted_Profile then + Discard_Node (RTE (RE_Activate_Restricted_Tasks)); + else + Discard_Node (RTE (RE_Activate_Tasks)); + end if; -- Task or Protected, must be of type Integer